Trending

Arduino Sequential LED Blinking

Hi everyone, today i will show you how to use your arduino board to create a sequence LED blinking project.

Components required

  1. Arduino Board(Any).
  2. 5 x LEDs
  3. 5 x 220 ohm Resistors
  4. Breadboard and connection wires.

Circuit and Connections.


  • Pin 12 to LED1 +ve
  • Pin 11 to LED2 +ve
  • Pin 10 to LED3 +ve
  • Pin 9 to LED4 +ve
  • Pin 8 to LED5 +ve
  • -ve pin of LEDs to ground with 220 ohm resistor. 

Coding

void setup() {
  pinMode(12, OUTPUT);  //digital pin as output mode.
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);
}
void loop() {
  digitalWrite(12, HIGH);   // HIGH is the voltage level
  delay(1000);                       // wait for a second
  digitalWrite(12, LOW);    // voltage is LOW
  digitalWrite(11, HIGH);   // HIGH is the voltage level
  delay(1000);                       // wait for a second
  digitalWrite(11, LOW);    // voltage is LOW
  digitalWrite(10, HIGH);   // HIGH is the voltage level
  delay(1000);                       // wait for a second
  digitalWrite(10, LOW);    // voltage is LOW
  digitalWrite(9, HIGH);   // HIGH is the voltage level
  delay(1000);                       // wait for a second
  digitalWrite(9, LOW);    // voltage is LOW
  digitalWrite(8, HIGH);   // HIGH is the voltage level
  delay(1000);                       // wait for a second
  digitalWrite(8, LOW);    // voltage is LOW
}

Done


No comments