/*
MSJ Researchers World
Date - 21st OCT 2024
Mentor - Mr. Siranjeevi M
Contact - 7373771991
*/
// Pin assignments
const int redLED = 4;
const int yellowLED = 5;
const int greenLED = 6;
void setup()
{
// Set all LEDs as output
pinMode(redLED, OUTPUT);
pinMode(yellowLED, OUTPUT);
pinMode(greenLED, OUTPUT);
}
void loop()
{
// Only Red light ON for 5 seconds
digitalWrite(redLED, HIGH);
digitalWrite(yellowLED, LOW);
digitalWrite(greenLED, LOW);
delay(3000);
// Red light OFF, Yellow light ON for 1 seconds
digitalWrite(redLED, LOW);
digitalWrite(yellowLED, HIGH);
delay(1000);
// Yellow light OFF, Green light ON for 5 seconds
digitalWrite(yellowLED, LOW);
digitalWrite(greenLED, HIGH);
delay(5000);
}