Want to blink LED sequentially? If “yes”, the post is for you.. we will learn how to blink two or more LED  in a sequential manner.

Components:

  1. 1x – Breadboard
  2. 1x – Arduino board with USB cable
  3. 7x – Male to male jumper wire
  4. 6x – LED (2 green, 2 blue & 2 red)
  5. 6x – resistor(100 ohm/330 ohm/1k anyone can be used)

steps:

  1. Connect 6 LEDs with arduino as shown in the schematic using breadboard. During this, be conscious about LED polarity.
  2. Connect your Arduino board (UNO) with your laptop.
  3. compile the arduino code given & upload it.
  4. If successfully uploaded, Enjoy the blinking.
  5. If not uploaded, please check the port settings & the arduino.

Arduino Code:

int LED1 = 2;
int LED2 = 3;
int LED3 = 4;
int LED4 = 5;
int LED5 = 6;
int LED6 = 7;
void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
}
void loop() {
digitalWrite(LED1, HIGH);
delay(200);
digitalWrite(LED2, HIGH);
delay(200);
digitalWrite(LED3, HIGH);
delay(200);
digitalWrite(LED4, HIGH);
delay(200);
digitalWrite(LED5, HIGH);
delay(200);
digitalWrite(LED6, HIGH);
delay(200);
digitalWrite(LED1, LOW);
delay(200);
digitalWrite(LED2, LOW);
delay(200);
digitalWrite(LED3, LOW);
delay(200);
digitalWrite(LED4, LOW);
delay(200);
digitalWrite(LED5, LOW);
delay(200);
digitalWrite(LED6, LOW);
delay(200);
}

1 Comment

  • Joshua Arietta

    June 27, 2019 - 11:05 am

    Normally I do not read post on blogs, but I wish to say that this write-up very forced me to try and do it! Your writing style has been amazed me. Thanks, very nice post.

Leave a Reply

Your email address will not be published. Required fields are marked *