// LED Button Blink Program #include #define F_CPU 1e6 #include #define TRUE 1 #define FALSE 0 int main() { //Button is on PA7 //LED is PB2 PORTA= _BV(PA7); //Turn button pullup resistor on DDRB = _BV(PB2); //Enable output on the LED pin PORTB = _BV(PB2); //Turns LED on //LOOP while (TRUE) { //button is not pushed if ((PINA & _BV(PA7))) { PORTB = 0; //turn LED off //else, turn LED on } else { PORTB = _BV(PB2); _delay_ms(1000); PORTB = 0; _delay_ms(1000); } } }