-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
This is caused by calling this ad the end of the loop:
if(_ledState == LED_STATE_FADE)
updateAnalog();
else if (_outputState != LED_FADED_ON)
updateDigital();
solution tested and working:
add a third led state in the .h :
#define LED_FADED_ON 2
change the case LED_STATE_FADE in the loop by this:
case LED_STATE_FADE:
if((millis() - _lastTime) <= _fadeTime) {
unsigned long progress = millis() - _lastTime;
_brightness = map(progress, 0, _fadeTime, _fadeFrom, _fadeTo);
}
else {
_ledState = LED_STATE_IDLE;
if (_fadeTo == 0) {
_outputState = LED_OFF;
}
else{
_outputState = LED_FADED_ON;
}
}
break;
change the last call of the loop by this:
if(_ledState == LED_STATE_FADE)
updateAnalog();
else if (_outputState != LED_FADED_ON)
updateDigital();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels