Skip to content

Instantly share code, notes, and snippets.

@pilinux
Created February 18, 2016 14:10
Show Gist options
  • Save pilinux/44062cb8b2ae78b5eb35 to your computer and use it in GitHub Desktop.
Save pilinux/44062cb8b2ae78b5eb35 to your computer and use it in GitHub Desktop.
Structure of AVR C (blinkLED.c explanation)
[comment]
anything written on the right side of `//` notation, i.e on
lines 1, 5, 9, 12, 13, 15, 17, 18, 20, 21 and 23.
[includes]
lines 2-3, here include other important files for your present projects.
[function definitions]
lines 6-7, define global variables and other functions
or include library of a function.
int main (void) {
your C program must have EXACTLY one main function!
[initialization]
line 13, initialize the chip or setting the registers for I/O.
[event loop]
lines 16-22
return(0);
this line is never reached in AVR C programming
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment