Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 955b277

Browse filesBrowse files
authored
fix(example): print correct fade direction (espressif#10450)
* fix(example): print correct fade direction * fix(example): Change to fade in out * fix(example): Codespell fix
1 parent 51b2fb3 commit 955b277
Copy full SHA for 955b277

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed

‎libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino

Copy file name to clipboardExpand all lines: libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define LEDC_FADE_TIME (3000)
2222

2323
bool fade_ended = false; // status of LED fade
24-
bool fade_on = true;
24+
bool fade_in = true;
2525

2626
void ARDUINO_ISR_ATTR LED_FADE_ISR() {
2727
fade_ended = true;
@@ -55,15 +55,15 @@ void loop() {
5555
Serial.println("LED fade ended");
5656
fade_ended = false;
5757

58-
// Check if last fade was fade on
59-
if (fade_on) {
58+
// Check what fade should be started next
59+
if (fade_in) {
6060
ledcFadeWithInterrupt(LED_PIN, LEDC_START_DUTY, LEDC_TARGET_DUTY, LEDC_FADE_TIME, LED_FADE_ISR);
61-
Serial.println("LED Fade off started.");
62-
fade_on = false;
61+
Serial.println("LED Fade in started.");
62+
fade_in = false;
6363
} else {
6464
ledcFadeWithInterrupt(LED_PIN, LEDC_TARGET_DUTY, LEDC_START_DUTY, LEDC_FADE_TIME, LED_FADE_ISR);
65-
Serial.println("LED Fade on started.");
66-
fade_on = true;
65+
Serial.println("LED Fade out started.");
66+
fade_in = true;
6767
}
6868
}
6969
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.