Skip to content

Commit

Permalink
Merge pull request #5116 from YakovL/patch-1
Browse files Browse the repository at this point in the history
fix the boundary check
  • Loading branch information
agdl committed Jul 11, 2016
2 parents e90cf55 + df8d22a commit cc6dfd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/shared/examples/01.Basics/Fade/Fade.ino
Expand Up @@ -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);
Expand Down

0 comments on commit cc6dfd2

Please sign in to comment.