HBLED::stopEffect

Hi @Ivan,
I noticed that when you call the stopEffect function, the led brightness is freezed to the value of that moment.
Maybe it could be added to the function explaination.

Could it be correct? I mean the brightness could go to a unknown value.
But you could always reset his value in the next code row :slight_smile:

That’s right @Mangaman, the LED takes the last value set by the effect. If you want to stop the effect with a given value you can always call HBLED::setValue, HBLED::setCurrent or start another effect.

The thing is that the HBLED doen’t know what it was doing before the effect. Stopping the effect with an arbitrary ‘zero value’ would be visible if the user delays the beginning of a new effect.

There is the (now undocumented) HBLED::getValue function to get the current value and ramp from there to the new effect, for a smooth transition.

There is a note for every effect that states:

But details will be added to the documentation of the `HBLED::stopEffect’ function in any case.