#define F_CPU 8000000UL #include "avr/io.h" #include "util/delay.h" int main () { DDRA = 0x00; DDRB = 0xFF; while (1) { if( (PINA&0x80) == 0) { PORTB = 0x06; _delay_ms (100); PORTB = 0x0C; _delay_ms (100); PORTB = 0x09; _delay_ms (100); PORTB = 0x03; _delay_ms (100); } else { PORTB = 0x06; _delay_ms (100); PORTB = 0x03; _delay_ms (100); PORTB = 0x09; _delay_ms (100); PORTB = 0x0C; _delay_ms (100); } } }