Smart Bracelet Part 1


#1

Hello! This serious is called, “Smart Bracelet.” It will be like turning on a phone, and click an app. You can add on to this series, just add a title that says Smart Bracelet Part (number of series). Here is the start. I will add some more soon. This is the game app.

bool isGreen;

void setup() {
LED led;
Timer timer;
led.turn_on_all(WHITE);
timer.pause(1000);
led.setLight(0,255,105,180);
timer.pause(1000);
led.turn_on_single(NW,BLUE);
led.turn_on_single(NW,GREEN);
timer.pause(1000);
led.setLight(2,135,206,235);
timer.pause(1000);
led.setLight(3,255,250,205);

}

void loop() {

}

void button_press(void){
LED led;
Timer timer;
led.setLight(0,255,105,180);
led.turn_on_single(NW,BLUE);
led.turn_on_single(NW,GREEN);
led.setLight(2,135,206,235);
led.setLight(3,255,250,205);
led.setLight(0,255,105,180);
timer.pause(1000);
led.setLight(0, 255,20,147);
timer.pause(1000);
led.setLight(0,255,105,180);
timer.pause(1000);
led.setLight(0,255,105,180);
led.setLight(1,255,105,180);
led.setLight(3,255,105,180);
timer.pause(1000);
led.setLight(2,255,105,180);

uint8_t rand_value;

// put your setup code here, to run once:
set_arduino_button();

// put your main code here, to run repeatedly:
rand_value = get_random_int(1,7);
color_chooser(rand_value);
}

void color_chooser(uint8_t ran_number){
ColorLabel color;

if(ran_number == 1)
color = BLUE;
if(ran_number == 2)
color = RED;
if(ran_number == 3)
color = GREEN;
if(ran_number == 4)
color = MAGENTA;
if(ran_number == 5)
color = WHITE;
if(ran_number == 6)
color = YELLOW;
if(ran_number == 7)
color = CYAN;

flash(color);
}

void flash(ColorLabel color){
LED led;
Timer timer;
if(color == GREEN)
isGreen = true;
else
isGreen = false;

led.turn_on_all(color);
timer.pause(500);
led.turn_off_all();
}

void long_button_press(void){
LED led;
Animation animation;
Buzzer buzz;

led.turn_off_all();

Timer timer;
if(isGreen){
    animation.rainbows();
    animation.rainbows();
 }
 else{
    led.turn_on_all(RED);
    buzz.short_buzz();
    timer.pause(300);
    led.turn_off_all();
    timer.pause(100); 
    led.turn_on_all(RED);
    buzz.short_buzz();
    timer.pause(300);
    led.turn_off_all();
    timer.pause(100); 
    led.turn_on_all(RED);
    buzz.short_buzz();
    timer.pause(300);
    led.turn_off_all();
    timer.pause(100); 
 }

}


#2

I love this! Uploading to my bot today.


#3

This seems cool, but i’m a little bit confused on what the whole program is.


#4

Amazfit 1S Smart Bracelet