// Blooming Microcontrolller
#include <avr/io.h>
#define F_CPU 1e6
#include <avr/delay.h>
#define TRUE 1
#define FALSE 0
int main()
{
//SETUP
//Button is on PB2
//LED is PA3
PORTA = _BV(PA3); //Turn button pullup resistor on
DDRB = _BV(PB2); //Enable output on the LED pin
//LOOP
while (TRUE)
{
PORTB = _BV(PB2);
_delay_ms(200);
PORTB = 0;
_delay_ms(200);
}
} |