#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); } } }