|
|
2 years ago | |
|---|---|---|
| .. | ||
| main | 2 years ago | |
| CMakeLists.txt | 3 years ago | |
| README.md | 2 years ago | |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|---|
(See the README.md file in the upper level 'examples' directory for more information about examples.)
This example shows how to control intensity of LEDs using selected SoC's on-board hardware LED PWM Controller module.
Connect four LEDs to the following LEDC channels / individual GPIOs:
| Channel 0 | Channel 1 | Channel 2 | Channel 3 | |
|---|---|---|---|---|
| ESP32 | GPIO18 | GPIO19 | GPIO4 | GPIO5 |
| All other chips | GPIO8 | GPIO9 | GPIO4 | GPIO5 |
idf.py menuconfig
Build the project and flash it to the board, then run the monitor tool to view the serial output:
Run idf.py -p PORT flash monitor to build, flash and monitor the project.
(To exit the serial monitor, type Ctrl-].)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
Running this example, you will see the four LEDs' brightness change repeatedly in the following orders
you can also see the following output log on the serial monitor:
1. LEDC fade up to duty = 4000
2. LEDC fade down to duty = 0
3. LEDC set duty = 4000 without fade
4. LEDC set duty = 0 without fade
...
Programming fail
idf.py -p PORT monitor, and reboot your board to see if there are any output logs.menuconfig menu, and try again.For any technical queries, please open an issue on GitHub. We will get back to you soon.