Javatpoint Logo
Javatpoint Logo

Blinking multiple LEDs using the loop

We have already discussed the method to blink a single LED and two LEDs.

In this project, we will discuss the process to blink three LEDs using for loop. The three LEDs will light up one after the other.

Let's start the process.

Hardware Required

The components required for the project are listed below:

  • 3 x red LED
  • 3 x 220 Ohm Resistors
  • Arduino UNO R3 board
  • Jump wires

We can use any color LED as per our choice.

Principle

We will connect the three LEDs to pins 13, 8, and 4 of the Arduino board. The limiting value of resistance should be between 220 and 330 ohms to set the optimal current through the LEDs.

The required resistance is enough to light up an LED without damaging the board and the LED. We will turn the LED ON/OFF individually.

Structure of the project

The structure clearly shows the pinout of the UNO board, and the three LEDs with resistors in series are connected to the board.

It is shown below:

Blinking multiple LEDs using the loop

Procedure

The connection of the above project is discussed below:

  • Connect the resistor of 220 Ohm in series with the three LEDs. Now connect it to the pin number 13, 8, and 4 of the Arduino board.
  • Connect the negative terminal of the three LEDs to the GND (Ground).

Sketch

Open the Arduino IDE and start with the coding, which is given below:

Connection Diagram

We will show the connection using the Simulator because the connections become clearer and more precise.

We can make the same connection using the hardware devices.

Blinking multiple LEDs using the loop





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA