Musical.ly Friendship Code?!


#1

I LOVE THE FRIENDSHIP CODING !!!
After seeing about it in the WEEK OF CODE stuff, I flipped the heck outt.

Then I thought of something kind of cool ??? What if I had my jewelbot light up to my different friends’ favorite songs whenever they come near me??!!! :heart_eyes: :two_hearts::two_hearts:

I’m super tone deaf, so I’m going to work with my friends to program their songs, but here is some code that I wrote!
It’s to react with RED and CYAN friends, using the musically code that @kairaygun and @sara made! It’s fun to just have on my bot even though theyre not my friends’ favorite songs. :musical_note: :musical_note: :musical_note:

Buzzer buzz;
LED led;
Timer timer;
Animation animation;

bool first_time_red = true;
bool first_time_cyan = true;

void setup() {
}

void loop() {
// Red friend group:
if ((see_red_friends()) && (first_time_red)) {
// Frank Ocean - Thinking About You
// Author: Kaira Villanueva

// 0 - 4 seconds
buzz.short_buzz();
led.turn_on_all(GREEN);
timer.pause(1000);
led.turn_on_all(BLUE); 
timer.pause(1000);
led.turn_on_all(RED);
timer.pause(1000);
led.turn_on_all(MAGENTA); 
timer.pause(1000);

// 5 - 36
led.turn_off_all();
timer.pause(3000);
buzz.short_buzz();
animation.jewelbots_logo();
timer.pause(1000);
animation.jewelbots_logo();
timer.pause(1000);
animation.jewelbots_logo();
timer.pause(1000);
animation.jewelbots_logo();
timer.pause(1000);
animation.jewelbots_logo();
timer.pause(1000);
animation.jewelbots_logo();
timer.pause(1000);
animation.jewelbots_logo();
timer.pause(1000);
animation.jewelbots_logo();
timer.pause(1000);
led.turn_off_all();
timer.pause(1000);
animation.jewelbots_logo();
first_time_red = false;

} else if ((!see_red_friends()) && (!first_time_red)) {
first_time_red = true;
}

// Cyan friend group:
if ((see_cyan_friends()) && (first_time_cyan)) {

// Closer - Chainsmokers
// Author: Sara Chipps

led.turn_on_all(RED);
buzz.short_buzz();
timer.pause(1900); 
led.turn_off_all();
timer.pause(1000);
led.turn_on_all(BLUE);
buzz.short_buzz();
timer.pause(1600); 
led.turn_off_all();
timer.pause(1000);
led.turn_on_all(GREEN);
buzz.short_buzz();
timer.pause(1600); 
led.turn_off_all();
timer.pause(1000);
led.turn_on_all(MAGENTA);
buzz.short_buzz();
timer.pause(1600); 
led.turn_off_all();
timer.pause(1000);
animation.jewelbots_logo();
led.turn_off_all();
timer.pause(400); 
animation.jewelbots_logo();
led.turn_off_all();
timer.pause(300); 
animation.rainbows();
animation.rainbows();
animation.rainbows();
animation.rainbows();
animation.rainbows();
first_time_cyan = false;

} else if ((!see_cyan_friends()) && (!first_time_cyan)) {
first_time_cyan = true;
}

} // loop


#2

WOAH. THAT IS COOL!
Can you please stop the grammatical errors you won’t let me explain my enthusiasm.


#3

grammatical errors? :open_mouth:


#4

If you type something with all caps and no sentence structure it will ask you if it is a complete sentence


#5

Wow! That must have took forever!


#6

You can find the better answer in below mentioned Youtube Channel.

Musically Videos