
The objective of this tutorial is to flash an LED by the ESP32 board: to turn the LED on and off alternately at 1 second intervals.
220Ω resistors
Connecting wires
Test plate
As for the assembly, it is easy to connect LEDs to the ESP32 board:
Connect pin D23 of the ESP32 card to the resistor leg
Then, we connect the second leg of the resistor to the anode (+ terminal) of the LED
Finally we connect the cathode (terminal -) of LED to the GND of the ESP32 board
1 2 3 4 5 6 7 8 9 |
import time from machine import Pin led=Pin(23,Pin.OUT) #Sets ESP32 board pin D23 to output mode while True: led.value(1) #Light up LED time.sleep(1) #Wait 1s led.value(0) #Turn off LED time.sleep(1) # Wait 1s |