// Pin definitions
const int redPin = 13;
const int yellowPin = 12;
const int greenPin = 11;
void setup() {
// Initialize the LED pins as outputs
pinMode(redPin, OUTPUT);
pinMode(yellowPin, OUTPUT);
pinMode(greenPin, OUTPUT);
}
void loop() {
// Turn on the red LED and turn off the others
digitalWrite(redPin, HIGH);
digitalWrite(yellowPin, LOW);
digitalWrite(greenPin, LOW);
delay(5000); // Red light for 5 seconds
// Turn on the yellow LED and turn off the others
digitalWrite(redPin, LOW);
digitalWrite(yellowPin, HIGH);
digitalWrite(greenPin, LOW);
delay(2000); // Yellow light for 2 seconds
// Turn on the green LED and turn off the others
digitalWrite(redPin, LOW);
digitalWrite(yellowPin, LOW);
digitalWrite(greenPin, HIGH);
delay(5000); // Green light for 5 seconds
// Optionally, you can add a delay before the next cycle
delay(1000); // Short delay before restarting the cycle
}