arduino-bare-metal-blink

Arduino blink example without IDE or additional libraries
Index Commits Files Refs README
main.c (312B)
   1 // (see sections 13.2.2 and 13.4 on datasheet)
   2 #define PINB (*(volatile unsigned char*) 0x23)
   3 #define DDRB (*(volatile unsigned char*) 0x24)
   4 
   5 int main(void) {
   6     DDRB |= (1 << 5);
   7 
   8     while(1) {
   9         PINB |= (1 << 5);
  10 
  11         for(volatile long i = 0; i < 500000L; ++i)
  12             ;
  13     }
  14 
  15     return 0;
  16 }