void setup() { DDRA = (1 << PA7); //OUTPUT LED on PA2 DDRB &= ~(1 << PB2); //set PB3 as input PORTB != (1 << PB2); //activate pull-up resistor for PB3 } void loop() { if (PINB & (1 << PB2)) // Redesign the Signal from PB2 { PORTA = (1 << PA7); //LED is ON _delay_ms(10); PORTA & = `~(1<< PA7); //LED is OFF _delay_ms(10); } else { PORTA = (1 << PA7); // LED is ON } }