Skip to content

Instantly share code, notes, and snippets.

@burakerdem
Forked from holachek/main.c
Created January 22, 2016 13:50
Show Gist options
  • Save burakerdem/aecbbfa43c829e08ffee to your computer and use it in GitHub Desktop.
Save burakerdem/aecbbfa43c829e08ffee to your computer and use it in GitHub Desktop.
AVR Tutorial main.c
#define F_CPU 1000000 // CPU frequency for proper time calculation in delay function
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRD |= (1 << PD6); // make PD6 an output
for(;;)
{
PORTD ^= (1 << PD6); // toggle PD6
_delay_ms(1000); // delay for a second
}
return 0; // the program executed successfully
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment