Magic Button pattern


#1

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:
set_arduino_button();
}
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);
timer.pause(500);
led.turn_on_single(NE, MAGENTA);
timer.pause(500);
led.turn_on_single(SW, GREEN);
timer.pause(500);
led.turn_on_single(SW, MAGENTA);
timer.pause(500);
}
led.turn_off_all();

//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);
timer.pause(500);
led.turn_off_single(NW);
led.setLight(3, 83, 4, 0); //orange
timer.pause(500);
led.turn_off_single(SE);
}
animation.breathe_single_color(CYAN); //the finale
}


#2

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


#3

SO COOL! I love it.


#4

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