const int redPin1 = 2; // Red LED for lane 1
const int yellowPin1 = 3; // Yellow LED for lane 1
const int greenPin1 = 4; // Green LED for lane 1
const int redPin2 = 5; // Red LED for lane 2
const int yellowPin2 = 6; // Yellow LED for lane 2
const int greenPin2 = 7; // Green LED for lane 2
const int redPin3 = 8; // Red LED for lane 3
const int yellowPin3 = 9; // Yellow LED for lane 3
const int greenPin3 = 10; // Green LED for lane 3
void setup() {
pinMode(redPin1, OUTPUT);
pinMode(yellowPin1, OUTPUT);
pinMode(greenPin1, OUTPUT);
pinMode(redPin2, OUTPUT);
pinMode(yellowPin2, OUTPUT);
pinMode(greenPin2, OUTPUT);
pinMode(redPin3, OUTPUT);
pinMode(yellowPin3, OUTPUT);
pinMode(greenPin3, OUTPUT);
}
void loop() {
// Lane 1: Red
digitalWrite(redPin1, HIGH);
digitalWrite(yellowPin1, LOW);
digitalWrite(greenPin1, LOW);
delay(3000); // Wait for 3 seconds
// Lane 1: Green
digitalWrite(redPin1, LOW);
digitalWrite(yellowPin1, LOW);
digitalWrite(greenPin1, HIGH);
delay(5000); // Wait for 3 seconds
// Lane 1: Yellow
digitalWrite(redPin1, LOW);
digitalWrite(yellowPin1, HIGH);
digitalWrite(greenPin1, LOW);
delay(5000); // Wait for 1 second
// Repeat the same pattern for other lanes (2 and 3)
}