Skip to content

Instantly share code, notes, and snippets.

Created June 1, 2014 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e30e8b9b4d7e73a1a8eb to your computer and use it in GitHub Desktop.
Save anonymous/e30e8b9b4d7e73a1a8eb to your computer and use it in GitHub Desktop.
Print to serial port on Spark Core
unsigned long lastTime = 0UL;
char message[64];
int sec = 10000;
int min = 5000;
int hours = 1000000;
void setup() {
Serial.begin(9600);
}
void loop() {
unsigned long now = millis();
//Every 15 seconds publish uptime
if (now-lastTime>15000UL) {
lastTime = now;
sprintf(message,"Pin: %d - State: %d - Delay: %d",hours++,min++,sec++);
Serial.println(message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment