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);
}