Merge pull request #5116 from YakovL/patch-1

fix the boundary check
This commit is contained in:
Arturo Guadalupi 2016-07-11 16:09:54 +02:00 committed by GitHub
commit cc6dfd239c
1 changed files with 2 additions and 2 deletions

View File

@ -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);