8 #ifndef COMPONENTS_MAGICBUTTON_SRC_WS2812ANIMATOR_H_
9 #define COMPONENTS_MAGICBUTTON_SRC_WS2812ANIMATOR_H_
20 AnimationState_Started,
21 AnimationState_Progress,
22 AnimationState_Completed
33 typedef std::function<void(const AnimationParam ¶m)> AnimationUpdateCallback;
34 typedef std::function<void()> AnimationFinishedCallback;
40 void start(AnimationUpdateCallback animUpdateCallback, AnimationFinishedCallback animFinishedCallback,
41 uint16_t duration = 0, uint16_t updateInterval = 0,
bool repeat =
false);
49 int getStep(
long elapsed,
long t,
int v);
50 float getStepFloat(
long elapsed,
long t,
float v);
52 AnimationUpdateCallback animationUpdateCallback_ = NULL;
53 AnimationFinishedCallback animationFinishedCallback_ = NULL;
54 boolean running_ =
false;
55 uint16_t updateInterval_ = 100, elapsed_ = 0, duration_ = 0;
56 uint32_t lastUpdated_ = 0;
Definition: Animator.h:25
void runAsync(void *data)
Body of the task to execute.
Definition: Animator.cpp:89
Encapsulate a runnable task.
Definition: Task.h:34
Definition: Animator.h:15