Espressif sigma-delta LED fade
Overview
This sample sweeps the pulse density of one sigma-delta channel between -90 and 90. Density zero is about a 50% PDM stream. Higher values spend more time high, so an LED wired from the GPIO to ground grows brighter and then dims.
The channel sample rate is 1 MHz. Connect an LED and a series resistor between the GPIO below and ground.
Board |
GPIO |
|---|---|
ESP32-DevKitC |
4 |
ESP32-S2-DevKitC |
4 |
ESP32-S3-DevKitC |
4 |
ESP32-C3-DevKitC |
4 |
ESP32-C5-DevKitC-1 |
4 |
ESP32-C6-DevKitC-1 |
18 |
ESP32-H2-DevKitM-1 |
4 |
ESP32-P4-Function-EV-Board |
6 |
ESP32-C2 and ESP32-C61 have no sigma-delta modulator, so this sample does not target their devkits.
Building and Running
Build for the board you are using. Example for the ESP32-C6 DevKitC:
west build -b esp32c6_devkitc/esp32c6/hpcore samples/boards/espressif/sdm