Fix conflict between documentation and example for method newChannel() (#3184)
It now correctly uses ledc.newChannel() and saves the return value instead of invoking ledc.setup().
This commit is contained in:
parent
6fe68679af
commit
04e01fd4ef
|
@ -15,7 +15,7 @@ Configures a PIN to be controlled by the LEDC system.
|
|||
|
||||
#### Syntax
|
||||
```lua
|
||||
ledc.setup({
|
||||
myChannel = ledc.newChannel({
|
||||
gpio=x,
|
||||
bits=ledc.TIMER_10_BIT || ledc.TIMER_11_BIT || ledc.TIMER_12_BIT || ledc.TIMER_13_BIT || ledc.TIMER_14_BIT || ledc.TIMER_15_BIT,
|
||||
mode=ledc.HIGH_SPEED || ledc.LOW_SPEED,
|
||||
|
@ -53,7 +53,7 @@ List of configuration tables:
|
|||
|
||||
#### Example
|
||||
```lua
|
||||
ledc.setup({
|
||||
myChannel = ledc.newChannel({
|
||||
gpio=19,
|
||||
bits=ledc.TIMER_13_BIT,
|
||||
mode=ledc.HIGH_SPEED,
|
||||
|
|
Loading…
Reference in New Issue