Arduino Nano 33 IoT - Blink multiple LED
This guide shows you how to set up the Arduino Nano 33 IoT to make several LEDs blink at the same time without using the delay function. Each LED can blink at its own speed. We use three LEDs as an example, but you can easily change the code to use more LEDs.

Hardware Preparation
Or you can buy the following sensor kits:
1 | × | DIYables Sensor Kit (30 sensors/displays) | |
1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of LED
We have a tutorial about LEDs. This guide gives clear, simple steps on how the LED works, explains the hardware pins, shows how to connect it to an Arduino Nano 33 IoT, and includes the code for it. Learn more at the following link:
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
Arduino Nano 33 IoT Code - Blink Multiple LEDs
To make many LEDs blink at once, we can't use the delay() function. Instead, we need to use the millis() function and keep track of the time.
Handling time records while blinking many LEDs can be hard for beginners. Fortunately, the ezLED library makes things easier because it manages the time records for you. You don't have to worry about it yourself. Also, you can make your code clearer and shorter by using an array of LEDs.
Detailed Instructions
If you are new to the Arduino Nano 33 IoT, be sure to check out our Getting Started with Arduino Nano 33 IoT tutorial. Then, follow these steps:
- Connect the components to the Arduino Nano 33 IoT board as depicted in the diagram.
- Use a USB cable to connect the Arduino Nano 33 IoT board to your computer.
- Launch the Arduino IDE on your computer.
- Select the Arduino Nano 33 IoT board and choose its corresponding COM port.
- Click on the Libraries icon on the left side of the Arduino IDE.
- Type ezLED in the search box and find the LED library by ArduinoGetStarted.
- Click the Install button to add the ezLED library.

- Copy the code above and paste it into the Arduino IDE. Then click the Upload button to compile and send the code to the Arduino Nano 33 IoT board.

- Look to see if the LED light is working.
Arduino Nano 33 IoT Code - Blink Multiple LEDs by using array
We can improve the previous code by using an array of LEDs. The code below uses this array to control the LED objects.
For flexible blinking, please check out the other functions in the ezLED library.