
The goal of this tutorial is to sound a buzzer with the ESP32 card:
Connecting wires
Test plate
The assembly consists in connecting the terminal (+) of the buzzer to pin D23 and the terminal (-) to the GND of the ESP32 card.
1 2 3 4 5 6 7 8 9 10 |
import time from machine import Pin buzzer=Pin(23,Pin.OUT) while True: buzzer.value(1) #the buzzer sounds time.sleep(2) # wait 2s buzzer.value(0) #the buzzer stops ringing time.sleep(2) # wait 2s |