diff --git a/build/shared/examples/01.Basics/Fade/Fade.ino b/build/shared/examples/01.Basics/Fade/Fade.ino index 1839ceca268..727d1484b21 100644 --- a/build/shared/examples/01.Basics/Fade/Fade.ino +++ b/build/shared/examples/01.Basics/Fade/Fade.ino @@ -32,8 +32,8 @@ void loop() { brightness = brightness + fadeAmount; // reverse the direction of the fading at the ends of the fade: - if (brightness == 0 || brightness == 255) { - fadeAmount = -fadeAmount ; + if (brightness <= 0 || brightness >= 255) { + fadeAmount = -fadeAmount; } // wait for 30 milliseconds to see the dimming effect delay(30);