Sparki’s 4th birthday!

Wow! Flashback to 3/11/2014 when I first opened my Sparki!

arcbotics sparki

Happy 4th birthday Sparki!

As a tribute, I taught Sparki to play Happy Birthday with the piezo buzzer. Or at least, a rendition of it!

Here is the really simple code:

#include <Sparki.h>
void setup(){
sparki.servo(60);
sparki.RGB(RGB_RED);
sparki.clearLCD();
delay(2000);
sparki.drawString(10,2,”It’s my”);
sparki.drawString(10,4,”birthday!”);
sparki.updateLCD();
delay(2000);
}
void part1(){
sparki.beep(450, 250);
delay(280);//hap
sparki.beep(450, 250);
delay(330);//hap
sparki.beep(500, 350);
delay(430);//birth
sparki.beep(450, 350);
delay(430);//day
sparki.beep(600, 350);
delay(430);//to
sparki.beep(550, 350);
delay(430);//you
delay(200);
}

void loop(){
for (int i = 0; i < 2; i=i+1)
{
part1();
}
sparki.beep(300, 250);
delay(280);//hap
sparki.beep(300, 250);
delay(330);//hap
sparki.beep(600, 350);
delay(430);//birth
sparki.beep(500, 350);
delay(400);//day
sparki.beep(400, 350);
delay(430);//dear
sparki.beep(450, 350);
delay(430);//blank
sparki.beep(300, 350);
delay(430);//blank
sparki.beep(550, 250);
delay(280);//hap
sparki.beep(550, 250);
delay(330);//hap
sparki.beep(500, 350);
delay(430);//birth
sparki.beep(400, 350);
delay(430);//day
sparki.beep(450, 350);
delay(430);//to
sparki.beep(400, 350);
delay(430);//you
delay(1000);
}

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s