

// Define the pin numbers for the LEDs
const int redLed = 9;
const int yellowLed = 10;
const int greenLed = 11;
void setup() {
// Set the LED pins as output
pinMode(redLed, OUTPUT);
pinMode(yellowLed, OUTPUT);
pinMode(greenLed, OUTPUT);
} void loop() {
// Red light for 5 seconds
digitalWrite(redLed, HIGH);
delay(5000);
digitalWrite(redLed, LOW);
// Yellow light for 2 seconds digitalWrite(yellowLed, HIGH);
delay(2000);
digitalWrite(yellowLed, LOW);
// Green light for 5 seconds
digitalWrite(greenLed, HIGH);
delay(5000);
digitalWrite(greenLed, LOW);
}
No downloadable resources added yet.
يرجى تسجيل الدخول لترك تعليق.
لا توجد تعليقات بعد. كن أول من يشارك رأيه!