Lab_interaccio/2016/hybridPlay/hybridPlay1.0.0/PowerLed.ino
2025-02-25 21:29:42 +01:00

13 lines
356 B
C++

void fadeLed(){
analogWrite(ledGreen, powerLedBrightness);
// change the brightness for next time through the loop:
powerLedBrightness = powerLedBrightness + powerLedFade;
// reverse the direction of the fading at the ends of the fade:
if (powerLedBrightness == 0 || powerLedBrightness == 255) {
powerLedFade = -powerLedFade;
}
}