#define F_CPU 16000000UL #define __AVR_ATmega328P__ #include #include int main(void) { DDRB = 0xff; while (1) { // green PORTB |= (1 << PORTB5); _delay_ms(500); PORTB &= ~(1 << PORTB5); // yellow PORTB |= (1 << PORTB4); _delay_ms(500); PORTB &= ~(1 << PORTB4); // red PORTB |= (1 << PORTB3); _delay_ms(500); PORTB &= ~(1 << PORTB3); // red and yellow PORTB |= (1 << PORTB3); PORTB |= (1 << PORTB4); _delay_ms(500); PORTB &= ~(1 << PORTB3); PORTB &= ~(1 << PORTB4); } }