mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
6b5e734901
1. add fading functions. 2. clear up ledc.c and ledc.h 3. update api doc. 4. add ledc example 5. edit ledc.rst and add readme for example code. 6. add s_ prefix for static global values. 7. add mutex for fade functions 8. minor changes according to the comments.
17 lines
514 B
Markdown
17 lines
514 B
Markdown
# LEDC(LED control) Example
|
|
|
|
###This example shows:
|
|
|
|
* init LEDC module:
|
|
|
|
a. You need to set the timer of LEDC first, this decide the frequency and resolution of PWM.
|
|
|
|
b. You need to set the LEDC channel you want to use, and bind the channel with one of the timers.
|
|
|
|
* You can install a default fade function, then you can use fade APIs.
|
|
|
|
* You can also set a target duty directly without fading.
|
|
|
|
* This example use GPIO18/19/4/5 as LEDC ouput, and it will change the duty repeatedly.
|
|
|