From 04e01fd4ef9142a0c182d645429486364cbe99db Mon Sep 17 00:00:00 2001 From: kiritnarain Date: Tue, 30 Jun 2020 17:22:12 +0530 Subject: [PATCH] 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(). --- docs/modules/ledc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/ledc.md b/docs/modules/ledc.md index 3e738954..9d19dcec 100644 --- a/docs/modules/ledc.md +++ b/docs/modules/ledc.md @@ -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,