Magic Button pattern


Here is a pattern that works with a friend who is paired as RED. When RED comes in range, it simply adds red light to the pattern. I also used the nice orange color that I found in another post.

void setup() {
// put your setup code here, to run once:
void loop() {
// put your main code here, to run repeatedly:


void button_press(void){
// Define what happens when the Magic Button is pressed quickly
// (when the Jewelbot is not plugged into power)
// I have RED set as a friend color, so I tried to find a pattern that would still be fun
// if a friend came in range while displaying this pattern.
LED led;
Timer timer;
Animation animation;

//PART1: Show two colors, alternate two times
for (int i = 0; i < 2; i++){
led.turn_on_single(NE, GREEN);
led.turn_on_single(NE, MAGENTA);
led.turn_on_single(SW, GREEN);
led.turn_on_single(SW, MAGENTA);

//PART2: Alternate ten times
// Use a custom RGB value
// input 1 is the LED position = (SE = 3, SW = 0, NW = 1, NE = 2)
// input 2,3,4 is values of R, G, and B. Can each accept a value from 0 to 63 or 0x0 to 0x3F
led.setLight(3, 83, 4, 0); //orange
for (int i = 0; i < 10; i++){
led.turn_on_single(NW, CYAN);
led.setLight(3, 83, 4, 0); //orange
animation.breathe_single_color(CYAN); //the finale


WHOA, this is cool!!! I can’t wait to test it!!


SO COOL! I love it.


It looks cool:slight_smile: I will try it when I have more time!