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.
2 parents e90cf55 + df8d22a commit cc6dfd2Copy full SHA for cc6dfd2
build/shared/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