Programming "Blinking External LED" on ESP32 using Arduino IDE
Welcome again!
This article will show step-by-step how to program external LED to blink using ESP32 and Arduino IDE. If you have not install the software, you can go to this link for installment and making the basic code: Programming "Blinking Internal LED" on ESP32 using Arduino IDE
STEP 1: Required Hardwares
1. ESP32
I will be using ESP32 Devkit V1
2. PC
3. Micro USB Cable
4. Breadboard
Breadboard is necessary to make sure ESP32's pins are not breaking during the installation.
5. Mini LED lamp
Since we will make blinking external LED, we will need LED lamp.
6. Resistor
I will be using resistor with 330 Ohm resistance.
7. Male-to-male Jumper cable
To connect all of the hardware in breadboard.
STEP 2: Arranging the Board
I arrange the board based on the picture below. The yellow cable is connecting ESP32's number 23 pin and the positive terminal of LED. The negative terminal of LED will connect to the resistor and the other terminal of resistor will connect to the ground using the black cable.
When the board already arranged, the board will more likely as shown below:
STEP 3: The Code and Compiling
Open the Arduino IDE in PC and use the following code in the program.
The variable ledPin will refer to which pin you are currently using on ESP32 board. Since i use 23th pin, the value is 23. After the code is ready in the IDE, compile the code by clicking checklist button on the top left of the IDE.
STEP 4: Connecting the Board and Uploading
Connect the arranged board to the PC using micro USB cable and make sure the power lamp in ESP32 is turned on.
STEP 5: Enjoy the Show
The external LED will blink with 1000ms interval. You can explore more by changing the delay variable.
Comments
Post a Comment