Write a program to interface LEDs on pin no. 10,11,12,13 and blink alternatively at the delay of 1 sec.
Last Updated : 16 Jul 2025
Solution:
void setup(){
// Initialize pins 10 through 13 as outputs
for(int led = 10; led <= 13; led++) {
pinMode(led, OUTPUT);
}
}
void loop(){
// Cycle through pins 10 to 13, turning each on and off
for(int led = 10; led <= 13; led++) {
digitalWrite(led, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(led, LOW); // Turn the LED off
}
}
Report an error
Meanwhile you can watch this video
Watch Video