We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49875c3 commit 11dcd5cCopy full SHA for 11dcd5c
libraries/ESP32/examples/AnalogOut/LEDCSingleChannel/LEDCSingleChannel.ino
@@ -26,7 +26,7 @@
26
#define LEDC_CHANNEL 0
27
28
int brightness = 0; // how bright the LED is
29
-int fadeAmount = 5; // how many points to fade the LED by
+int fadeAmount = 4; // how many points to fade the LED by
30
31
void setup() {
32
// Use single LEDC channel 0 for both pins
@@ -42,7 +42,7 @@ void loop() {
42
brightness = brightness + fadeAmount;
43
44
// reverse the direction of the fading at the ends of the fade:
45
- if (brightness <= 0 || brightness >= 255) {
+ if (brightness <= 0 || brightness >= 256) {
46
fadeAmount = -fadeAmount;
47
}
48
// wait for 30 milliseconds to see the dimming effect
0 commit comments