mirror of https://github.com/noisymime/Arduino.git
commit
cc6dfd239c
|
@ -32,8 +32,8 @@ void loop() {
|
||||||
brightness = brightness + fadeAmount;
|
brightness = brightness + fadeAmount;
|
||||||
|
|
||||||
// reverse the direction of the fading at the ends of the fade:
|
// reverse the direction of the fading at the ends of the fade:
|
||||||
if (brightness == 0 || brightness == 255) {
|
if (brightness <= 0 || brightness >= 255) {
|
||||||
fadeAmount = -fadeAmount ;
|
fadeAmount = -fadeAmount;
|
||||||
}
|
}
|
||||||
// wait for 30 milliseconds to see the dimming effect
|
// wait for 30 milliseconds to see the dimming effect
|
||||||
delay(30);
|
delay(30);
|
||||||
|
|
Loading…
Reference in New Issue