Welcome

Firmware - NeoAnimation

Webpage under construction

NeoAnimation

Here is how to get started with NeoAnimations. There are two types of NeoAnimation: Home and Alert. Home animations run by default. If there is an Alert animation, that will override the Home animation. When the Alert animation is done, it will return to Home animation. Here's an example code snippet to set up a home animation:


setNeoAnim(&neo_animation_home, NEO_ANIM_FUNKY, NEO_ANIM_HOME);
setNeoAnimColours(&neo_animation_home, NEO_LAVENDER, NEO_SKY_BLUE);
setNeoAnimSpeed(&neo_animation_home, 300);
startNeoAnim(&neo_animation_home);
      

Let's go through this line by line:


1. setNeoAnim(&neo_animation_home, NEO_ANIM_FUNKY, NEO_ANIM_HOME);
      

1. This sets the home neo animation to the 'funky' animation. Check out the list below for all the animation names.


2. setNeoAnimColours(&neo_animation_home, NEO_LAVENDER, NEO_SKY_BLUE);
      

2. Now for the home animation we'll set the primary and secondary colours. Check out the list below for all the colour names.


3. setNeoAnimSpeed(&neo_animation_home, 300);
      

3. Here's setting the animation speed. A smaller number makes the animation faster, and a larger number makes the animation slower.


4. startNeoAnim(&neo_animation_home);
      

4. Now let's start the animation! It will repeat indefinitely, unless it has a certain time duration or number of repeats. Those parameters can be set using the API functions.

To make the example snippet for the alert animation, simply change home to alert, like so:


setNeoAnim(&neo_animation_alert, NEO_ANIM_FUNKY, NEO_ANIM_ALERT);
setNeoAnimColours(&neo_animation_alert, NEO_LAVENDER, NEO_SKY_BLUE);
setNeoAnimSpeed(&neo_animation_alert, 300);
startNeoAnim(&neo_animation_alert);
      

To adjust additional parameters, check out the NeoAnimation API functions. Some functions are animation specific.

NeoAnimation API

Here are the NeoAnimation API functions to adjust parameters of the home or alert functions. Some of these are animation specific.


void setNeoAnim(struct NeoAnimation *a, uint8_t n, uint8_t t);
void setNeoAnimColours(struct NeoAnimation *a, uint8_t c1, uint8_t c2);
void setNeoAnimDuration(struct NeoAnimation *a, long duration);
void setNeoAnimRepeats(struct NeoAnimation *a, int r);
void setNeoAnimSpeed(struct NeoAnimation *a, uint16_t del);
void startNeoAnim(struct NeoAnimation *a);
void stopNeoAnim(struct NeoAnimation *a);
void setNeoAnimDir(struct NeoAnimation *a, bool dir);
      

Animation specific:


void setNeoAnimRangeVal(struct NeoAnimation *a, int val);
void setNeoAnimRainbowSteps(struct NeoAnimation *a, int val);
void setNeoAnimBreatheSteps(struct NeoAnimation *a, int val);
void setNeoAnimBreatheMaxBrightness(struct NeoAnimation *a, int val);
void setNeoAnimAmbiance(struct NeoAnimation *a, int id);
void setNeoAnimUno(struct NeoAnimation *a, int uno);
void setNeoAnimDuo(struct NeoAnimation *a, int duo);
      

RTOS specific:


void setNeoAnimationTaskPriority(uint8_t p);
      

Here are the callbacks:


NeoCallback onNeoAnimDoneCallback_client;
NeoCallback onNeoAnimLoopCallback_client;
      

NeoAnimation Names

Here are the names of the various NeoAnimations. The sandbox sketch RobotButterflyNeoAnimation provides a way to surf through these via command line to see them in action.


NEO_ANIM_NONE,
NEO_ANIM_POLKADOT,
NEO_ANIM_SQUIGGLE,
NEO_ANIM_RANGE,
NEO_ANIM_FUNKY,
NEO_ANIM_ZWOOP,
NEO_ANIM_SPRINKLE,
NEO_ANIM_RAINBOW,
NEO_ANIM_RAINBOW_ALL,
NEO_ANIM_BOUNCE,
NEO_ANIM_BREATHE,
NEO_ANIM_CYCLE8,
NEO_ANIM_CYCLE3,
NEO_ANIM_AMBIANCE,
NEO_ANIM_UNO
      

NeoAnimation Colours

Here are the colours available for NeoAnimations. The sandbox sketch RobotButterflyNeoColours provides a way to surf through these via command line to see them in action.


NEO_RED,
NEO_ORANGE,
NEO_GOLDEN_YELLOW,
NEO_CANARY_YELLOW,
NEO_GREEN,
NEO_SKY_BLUE,
NEO_BLUE,
NEO_CYAN,
NEO_PURPLE,
NEO_LAVENDER,
NEO_PINK,
NEO_MAGENTA,
NEO_WARM_WHITE,
NEO_WHITE,
NEO_OFF