Just to answer your question, here’s a simple timer code using the millis() function in Arduino…of course it can be improve upon. The millis() function is only valid while Sparki is on, once powered off the clock starts at 0:0:0 when the program is resumed.
[code]
/*******************************************
Basic millis() test
Show the time since the program started
********************************************/
#include <Arduino.h> // include the arduino library
#include <Sparki.h> // include the sparki library
int secs, mins, hrs;
void setup()
{
}
void loop()
{
sparki.clearLCD();
secs = millis()/1000;
mins = secs/60;
hrs = secs / 3600;
mins = mins - hrs60;
secs = secs - mins60;
sparki.print("hours: ");
sparki.println(hrs); // prints hrs since program started
sparki.print("minutes: ");
sparki.println(mins); // prints mins since program started
sparki.print("seconds: ");
sparki.println(secs); // prints secs since program started
// wait a second so as not to send massive amounts of data
delay(1000);
sparki.updateLCD();
}[/code]