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:
kiritnarain 2020-06-30 17:22:12 +05:30 committed by GitHub
parent 6fe68679af
commit 04e01fd4ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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,