Closed TheLastGimbus closed 2 years ago
@TheLastGimbus: If the period is e.g. 500 like in your example, the value for t goes from 0 to 499, not from 0 to 500, t=500 will not be reached. The value is set twice because JLed makes sure that when Update
is called for after the effects time elapsed, then the last value set, is that for period-1
or 499
in this example. This is necessary to handle edge cases like e.g.
led.Update();
delay(600);
led.Update();
Then JLed will make sure to set the LED's value to the value of t=499. Perphaps the addtional call could be optimized out, I'll have a look at it, but I don't see a problem here.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days
Hi!
I wanted to write my own function that would just fade led linearly (btw this should be added to this lib).
So I wrote:
...but the led never fully turned off :(
So I added some prints:
And for
LinearFadeOff usrEffOff(500);
, it prints::confused:
The problem: Last value doubles instead of reaching the end :rainbow: