We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f3e657a + e8dc43e commit 98592d4Copy full SHA for 98592d4
examples/01.Basics/Fade/Fade.ino
@@ -32,8 +32,8 @@ void loop() {
32
brightness = brightness + fadeAmount;
33
34
// reverse the direction of the fading at the ends of the fade:
35
- if (brightness == 0 || brightness == 255) {
36
- fadeAmount = -fadeAmount ;
+ if (brightness <= 0 || brightness >= 255) {
+ fadeAmount = -fadeAmount;
37
}
38
// wait for 30 milliseconds to see the dimming effect
39
delay(30);
0 commit comments