Sparki arduino plays We Wish You a Merry Christmas with simple LCD animated scene

Sparki is feeling the festivities this year after his successful Jingle Bells rendition last year.

DSC_8599

So this year it’s: We Wish You a Merry Christmas. Accompanied by a very simple Christmas themed animation on the LCD screen ❤  This is something I am hoping to use and learn about a lot more next year.

Hope you like it. Happy holidays everyone.

Here is the code:

#include <Sparki.h>
void setup() {
sparki.servo(60);
sparki.RGB(RGB_RED);
sparki.clearLCD();
delay(2000);
sparki.drawString(40, 2, “MERRY”);
sparki.drawString(30, 4, “CHRISTMAS!”);
sparki.updateLCD();
int singing = 0;
int animation = 0;
delay(2000);

}
void fulltree() {
sparki.clearLCD();
sparki.drawLine(30, 25, 40, 25); //join in triangles
sparki.drawLine(85, 25, 75, 25); //join in triangles
sparki.drawLine(30, 25, 57, 5);
sparki.drawLine(85, 25, 57, 5);

sparki.drawLine(15, 50, 100, 50); //bottom of triangle
sparki.drawLine(15, 50, 40, 25);
sparki.drawLine(100, 50, 75, 25);

sparki.drawLine(52, 50, 52, 60);
sparki.drawLine(62, 50, 62, 60);
sparki.drawLine(52, 60, 62, 60);
sparki.drawCircleFilled(40, 45, 2);

sparki.drawCircleFilled(57, 42, 2);

sparki.drawCircleFilled(74, 40, 2);

sparki.drawCircleFilled(48, 35, 2);

sparki.drawCircleFilled(65, 32, 2);

sparki.drawCircleFilled(43, 25, 2);

sparki.drawCircleFilled(55, 22, 2);

sparki.drawCircleFilled(67, 20, 2);

sparki.drawCircleFilled(85, 45, 2);

sparki.drawCircleFilled(30, 38, 2);

sparki.drawCircleFilled(50, 16, 2);

sparki.updateLCD();
}
void snow1() {
sparki.clearLCD();
fulltree();
sparki.drawCircleFilled(5, 6, 1);
sparki.drawCircleFilled(50, 6, 1);
sparki.drawCircleFilled(30, 16, 1);
sparki.drawCircleFilled(20, 20, 1);
sparki.drawCircleFilled(10, 36, 1);
sparki.drawCircleFilled(70, 6, 1);
sparki.drawCircleFilled(90, 26, 1);
sparki.drawCircleFilled(110, 20, 1);
sparki.drawCircleFilled(120, 30, 1);

sparki.drawCircleFilled(97, 40, 1);
sparki.drawCircleFilled(115, 35, 1);
sparki.drawCircleFilled(120, 16, 1);

sparki.updateLCD();
}
void snow2() {
sparki.clearLCD();
fulltree();
sparki.drawCircleFilled(15, 6, 1);
sparki.drawCircleFilled(40, 6, 1);
sparki.drawCircleFilled(50, 16, 1);
sparki.drawCircleFilled(30, 20, 1);
sparki.drawCircleFilled(20, 36, 1);
sparki.drawCircleFilled(65, 6, 1);
sparki.drawCircleFilled(85, 16, 1);
sparki.drawCircleFilled(100, 20, 1);
sparki.drawCircleFilled(110, 30, 1);
sparki.drawCircleFilled(115, 6, 1);
sparki.drawCircleFilled(120, 12, 1);
sparki.drawCircleFilled(90, 10, 1);
sparki.drawCircleFilled(110, 45, 1);
sparki.drawCircleFilled(100, 40, 1);
sparki.drawCircleFilled(5, 30, 1);
sparki.drawCircleFilled(20, 27, 1);

sparki.updateLCD();
}
void loop() {
snow1();
sparki.beep(300, 400);
delay(480);//we
sparki.beep(400, 300);
delay(480);//wish
sparki.beep(400, 150);
delay(240);//you
sparki.beep(450, 150);
delay(240);//a
snow2();
sparki.beep(400, 150);
delay(240);//mer
sparki.beep(350, 150);
delay(240);//ry
sparki.beep(300, 300);
delay(480);//christ
sparki.beep(300, 300);
delay(580);//mas

for (int i = 0; i < 2; i++) {
snow1();
sparki.beep(300, 400);
delay(480);//we
sparki.beep(450, 300);
delay(480);//wish
sparki.beep(450, 150);
delay(240);//you
sparki.beep(500, 150);
delay(240);//a
snow2();
sparki.beep(450, 150);
delay(240);//mer
sparki.beep(400, 150);
delay(240);//ry
sparki.beep(370, 300);
delay(480);//christ
sparki.beep(300, 300);
delay(580);//mas

}
snow1();
sparki.beep(300, 150);
delay(240);//and
sparki.beep(300, 150);
delay(240);//a
sparki.beep(300, 300);
delay(480);//hap
snow2();
sparki.beep(450, 300);
delay(480);//py
sparki.beep(370, 300);
delay(480);//new
sparki.beep(400, 680);
delay(10000);//year

}

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