// define the pins for the traffic light
int redPin = 8;
int yellowPin = 9;
int greenPin = 10;
void setup() {
// set the traffic light pins as outputs
DDRB = B00111;
}
void loop() {
// turn the red light on for 3 seconds
PORTB = B100;
delay(3000);
// turn the yellow light on for 1 seconds
PORTB = B010;
delay(1000);
// turn the green light on for 3 seconds
PORTB = B001;
delay(3000);
}