02 · Make some sound
Open this interactive lesson and device downloads
Goal
Drive the GPIO42 passive buzzer with a configurable tone. Only the board and a USB data cable are required.
Simulation and hardware
Frequency is 220–1760 Hz; duration is 100–1000 ms, followed by 100 ms of silence. Defaults are 440 Hz and 300 ms. Enable browser audio for the simulation. Hardware uses LEDC with a 50% duty cycle.
Select “Flash controller” to download the firmware. Connect over USB, adjust frequency or duration, then select “Apply to controller”. Select “Save to controller” to retain these values after power loss. Source: 02_buzzer/main/main.c.
Exercise
Double the frequency and compare pitch, then change only duration. The browser audio setting does not mute the physical board.
Download
Use “Flash controller” to connect and download over USB. After automatic reconnection, open “Serial monitor” for logs. Adjusting this lesson’s parameters does not require another download.
Troubleshooting
For hardware, check the running project and parameters. For browser audio, check its sound toggle and volume.