Skip to content

Commit 04e01fd

Browse files
authored
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().
1 parent 6fe6867 commit 04e01fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/modules/ledc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Configures a PIN to be controlled by the LEDC system.
1515

1616
#### Syntax
1717
```lua
18-
ledc.setup({
18+
myChannel = ledc.newChannel({
1919
gpio=x,
2020
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,
2121
mode=ledc.HIGH_SPEED || ledc.LOW_SPEED,
@@ -53,7 +53,7 @@ List of configuration tables:
5353

5454
#### Example
5555
```lua
56-
ledc.setup({
56+
myChannel = ledc.newChannel({
5757
gpio=19,
5858
bits=ledc.TIMER_13_BIT,
5959
mode=ledc.HIGH_SPEED,

0 commit comments

Comments
 (0)