Back

Here is how you code the Jewelbots LEDs to animate!

The Animation class constructs objects that represent all the LEDs attached to the physical Jewelbot. There are 4 LEDs total that are connected to the Jewelbot.

COMPONENT INTIALIZATION

Animation animation; //naming the variable type and then the name of variable.

In order to use the LED functions, you first need to initialize the library. This tells your program that you want to code around the LEDs, then you can use the functions below to do cool things with LEDs!

The different functions are called the "API", because they are the way you interact with the device. APIs are ways you can work with different interfaces, sometimes in a computer and sometimes online.

PARAMETERS

There are also lots of different colors you can make your Jewelbots light up! The list of color names you can use are:

RED, GREEN, BLUE, MAGENTA, YELLOW, CYAN, WHITE, ORANGE, GOLD, PURPLE, PERIWINKLE, ROSE, OCEAN, and SKY.

API

.rainbows()

This function has your Jewelbot flash a rainbow color animation.

Animation animation; animation.rainbows();

.jewelbots_logo()

This function has your Jewelbot showing the colors of the Jewelbot logo on all 4 of the LEDs.

Animation animation; animation.jewelbots_logo();

.breathe_single_color(ColorLabel color)

This function turns the LEDs on and turns them off slowly, looking like a breathing pattern.

Animation animation; animation.breathe_single_color(GREEN);

.bouncing_ball

This function is an animation invented by Jewelbots' ambassador Ellie! It's a OCEAN colored Jewelbot with a MEGENTA ball randomly jumping around!

Animation animation; animation.bouncing_ball();