Feature #228
CPwmLine: implement blink mode adjustement
Beginn:
24.08.2022
Abgabedatum:
% erledigt:
0%
Geschätzter Aufwand:
CS Zielversion:
Beschreibung
The beep mode e.g. handles fade in/out Light or to have an smothly blinking LED.
A special feature is needed to enter the mode at a special position.
e.g. when an display Backlight is fading out and someone is touching it, the fading in should not start at the
defined start point but at the brightness where it was when fading out.
Same thing for amibent light. This could also be done by creating an dynamic blink mode. But having static ones
and jumping to the right position automatically, makes it much easier.
int diffPerms=( ( ( slope.endValue - slope.startValue ) * 1000 ) / (FTYPE)slope.duration );
int currentFrequency = slope.startValue + ( ( (FTYPE)elapsedMSeconds(m_timer) * diffPerms ) / 1000 );
Example: from 1000 to 80 in 1 sec; current value is 540
diffPerms = ((80-1000)*1000) / 1000)=-920 (/1000)
timeShift = ( ( start - current ) * 1000) / diffPerms = -500
timeShift = ( ( 540 - 80 ) * 1000) / -920 = -500
timeShift = ( ( 1000 - 80 ) * 1000) / -920 = -1000 // Its over
// Thats the time to be added to the start time
Zugehörige Tickets
Historie
Von Maximilian Seesslen vor mehr als 2 Jahren aktualisiert
- Kopiert von Feature #226: CPwmLine: implement blink mode wurde hinzugefügt
Von Maximilian Seesslen vor 11 Monaten aktualisiert
- Status wurde von Neu zu Abgewiesen geändert
CFader() already handles this.
The fading speed is calculated at initialization time. Afterwards only the target is changed.