Sparki the chocolate delivery robot

So this was a really short and simple program I wrote for Easter, with Sparki delivering chocolate coins to people around a table. He simple spins around looking for a hand, and drives towards this for them to remove a chocolate coin from the basket. Sparki will then display Happy Easter on the LCD screen.

#include // include the sparki library
void setup() {
sparki.servo(0);
}
void loop() {
sparki.clearLCD();
sparki.drawString(10,2, "Chocolate");
sparki.drawString(10,5,"Delivery");
sparki.updateLCD();
delay(2000);
sparki.beep();
sparki.ping();
while(sparki.ping()>10)
{
sparki.moveRight();
sparki.clearLCD();
sparki.drawString(20,2, "Searching...");
sparki.updateLCD();
delay (1000);
}
sparki.moveForward(3);
sparki.clearLCD();
sparki.drawString(20,2, "Happy Easter");
sparki.updateLCD();
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