#include #include #define F_CPU 1000000L main(void) { DDRA = 0b10000000; //Makes LED pin 7 of PORTA as Output & Makes Button pin 3 of PORTA as Input while(1) //infinite loop { if(PINA & (1<< PA3) == 1) //If switch is pressed { PORTA |= (1<< PA7); //Turns ON LED _delay_ms(3000); //3 second delay PORTA &= ~(1<< PA7); //Turns OFF LED } } }