mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
commit
cc6dfd239c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user