Created
June 1, 2014 10:53
-
-
Save anonymous/e30e8b9b4d7e73a1a8eb to your computer and use it in GitHub Desktop.
Print to serial port on Spark Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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