Table of Contents

How to Blink an LED Using ESP32

ESP32 LED Blinking
Example Description
Build a simple LED-blinking project using an ESP32 and PictoBlox. Learn how to connect the board, configure a digital output, and write a block-based program that switches an LED ON and OFF at regular intervals.

Introduction

The ESP32 is a microcontroller development board that can control electronic components through its digital GPIO pins. In this project, PictoBlox is used to program the ESP32 to produce a repeating HIGH–LOW output. This output can control a compatible LED and introduces the fundamentals of hardware programming.

Prerequisites / Setting Up the Hardware

Setting Up the Hardware

  1. Open PictoBlox and create a new block project.
    open pictoblox
  2. Select ESP32 as the board.
    Select ESP32 Board
  3. Connect the ESP32 board to the computer using a USB cable.
    Serial port Connection via usb

Step-by-Step Block Coding Guide 

  1. Switch to upload mode
    Switch to Upload Mode
  2. Add the ESP32 Start Block
    when esp32 block start up
  3. Add a Forever Loop
    esp32 start with forever loop
  4. Add set digital pin [2] output as [HIGH]. The selected GPIO output becomes HIGH.
    esp32 forever and set digital pin with high op
  5. Add wait [1] seconds to keep the output HIGH for one second.
    esp32 forever and set digital pin with high op with wait
  6. Add set digital pin [2] output as [LOW] to switch the output to LOW.
    esp32 forever and set digital pin with high op with wait and agian op as low
  7. Add another wait [1] seconds block before the loop repeats.
    esp32 forever and set digital pin with high op with wait and agian op as low with wait block
  8. Upload and Run the Program.

Output Video

ESP32 led blinking output video

Conclusion

You learned how to connect an ESP32 to PictoBlox and configure a digital output.
You created a repeating LED-blinking sequence using visual programming blocks.
You explored the relationship between GPIO states and electronic components.
This project builds a foundation for controlling sensors, LEDs, and other actuators with ESP32.