Skip to content

Instantly share code, notes, and snippets.

@GSala
Created January 26, 2015 13:05
Show Gist options
  • Save GSala/63e8097e6f8aa921ecf2 to your computer and use it in GitHub Desktop.
Save GSala/63e8097e6f8aa921ecf2 to your computer and use it in GitHub Desktop.
#include <avr/io.h>
#define F_CPU 3686400
#include <avr/delay.h>
int main(void)
{
unsigned char i = 0;
DDRA = 0;
DDRB = 0xFF;
while(1)
{
PORTB = ~i;
i++;
_delay_ms(500);
if((PINA & 0b10000000)==0)
i=0;
//TODO:: Please write your application code
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment