jled
jled copied to clipboard
Allow to trigger callback after an effect is finished
#82 inspired this MR:
Added a new UpdateAndFinally method that will update the effect like Update but will trigger the provided callback when the effect is finished. This allows e.g. reconfiguration of an effect.
Example:
#include <jled.h>
auto breathe = JLed(2).Breathe(500);
void setup() { }
void loop() {
breathe.UpdateAndFinally(
[] (JLed& led, void*) {
led.Breathe(random(50,5000));
led.Reset();
}
);
}