RSeries astromech firmware
Animation Scripts

Animation scripts provide a way to execute multi-step animation sequences without blocking the rest of the system.

ANIMATION(simpleMultiStepAnimation)
{
// Step One - fires once and waits 300ms before advancing
DO_SEQUENCE(SeqPanelAllOpenLong, DOME_PANELS_MASK)
// Step Two - fires once
DO_COMMAND_AND_WAIT("HPF0026|20", 100)
// Step Three - fires repeatedly for 200ms
DO_DURATION(200, {
DEBUG_PRINTLN(elapsedMillis);
})
// Step Four
DO_ONCE({ frontHolo.play("Leia.bd2"); })
// Step Five
DO_COMMAND("HPF0026|20")
// Step Six - repeat this step until "num" reaches 100 then rewind the animation
if (num == 100)
animation.rewind();
})
}
DO_START
#define DO_START()
Definition: Animation.h:15
DO_SEQUENCE
#define DO_SEQUENCE(seq, mask)
Definition: Animation.h:28
DEBUG_PRINTLN
#define DEBUG_PRINTLN(s)
Definition: ReelTwo.h:188
DO_ONCE
#define DO_ONCE(p)
Definition: Animation.h:19
ANIMATION
#define ANIMATION(name)
Definition: Animation.h:14
DO_COMMAND_AND_WAIT
#define DO_COMMAND_AND_WAIT(cmd, ms)
Definition: Animation.h:35
DO_DURATION
#define DO_DURATION(ms, p)
Definition: Animation.h:22
DO_END
#define DO_END()
Definition: Animation.h:39
DO_FOREVER
#define DO_FOREVER(p)
Definition: Animation.h:21
DO_COMMAND
#define DO_COMMAND(cmd)
Definition: Animation.h:34