// Mozah //PB2 is LED pin //PA3 is button #include int main (void) { DDRB |= (1 << PB2); //Setting PB2 as output (LED) DDRA &= ~(1 << PA3); // setting PA3 as input (Button) PORTA |= (1 << PA3); // Activate Pull-up resistor at PA3 while(1) { if (PINA &(1<< PA3)) { //if button pressed PORTB &= ~(1 << PB2); // set PB2 high = switch on LED } else { PORTB |= (1 << PB2); // set PB2 high = switch off LED } } }