From 7fa14cc6834195ce7b8bab6d2eb2acea9433b1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:20:07 +0200 Subject: [PATCH 1/3] fix(example): print correct fade direction --- libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino b/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino index dc152a63ea4..49f67a03bda 100644 --- a/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino +++ b/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino @@ -58,11 +58,11 @@ void loop() { // Check if last fade was fade on if (fade_on) { ledcFadeWithInterrupt(LED_PIN, LEDC_START_DUTY, LEDC_TARGET_DUTY, LEDC_FADE_TIME, LED_FADE_ISR); - Serial.println("LED Fade off started."); + Serial.println("LED Fade on started."); fade_on = false; } else { ledcFadeWithInterrupt(LED_PIN, LEDC_TARGET_DUTY, LEDC_START_DUTY, LEDC_FADE_TIME, LED_FADE_ISR); - Serial.println("LED Fade on started."); + Serial.println("LED Fade off started."); fade_on = true; } } From dad3cb3d5cc6c79f1ee640342f631b35456596e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:59:14 +0200 Subject: [PATCH 2/3] fix(example): Change to fade in out --- .../ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino b/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino index 49f67a03bda..2665c41a863 100644 --- a/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino +++ b/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino @@ -21,7 +21,7 @@ #define LEDC_FADE_TIME (3000) bool fade_ended = false; // status of LED fade -bool fade_on = true; +bool fade_in = true; void ARDUINO_ISR_ATTR LED_FADE_ISR() { fade_ended = true; @@ -55,15 +55,15 @@ void loop() { Serial.println("LED fade ended"); fade_ended = false; - // Check if last fade was fade on - if (fade_on) { + // Check what fade shoud be started next + if (fade_in) { ledcFadeWithInterrupt(LED_PIN, LEDC_START_DUTY, LEDC_TARGET_DUTY, LEDC_FADE_TIME, LED_FADE_ISR); - Serial.println("LED Fade on started."); - fade_on = false; + Serial.println("LED Fade in started."); + fade_in = false; } else { ledcFadeWithInterrupt(LED_PIN, LEDC_TARGET_DUTY, LEDC_START_DUTY, LEDC_FADE_TIME, LED_FADE_ISR); - Serial.println("LED Fade off started."); - fade_on = true; + Serial.println("LED Fade out started."); + fade_in = true; } } } From c21ff2817e10a3ea574dbac254a9173b0075d93a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:02:09 +0200 Subject: [PATCH 3/3] fix(example): Codespell fix --- libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino b/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino index 2665c41a863..7155d2791cb 100644 --- a/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino +++ b/libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino @@ -55,7 +55,7 @@ void loop() { Serial.println("LED fade ended"); fade_ended = false; - // Check what fade shoud be started next + // Check what fade should be started next if (fade_in) { ledcFadeWithInterrupt(LED_PIN, LEDC_START_DUTY, LEDC_TARGET_DUTY, LEDC_FADE_TIME, LED_FADE_ISR); Serial.println("LED Fade in started.");