Created
January 22, 2014 12:36
-
-
Save mrichardson23/8558011 to your computer and use it in GitHub Desktop.
int from server to Galileo
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
void setup() { | |
// put your setup code here, to run once: | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
Serial.println(getHours()); | |
delay(5000); | |
} | |
int getHours() { | |
char output[5]; | |
system("curl http://nextmakemagazine.appspot.com/simple > response.txt"); | |
FILE *fp; | |
fp = fopen("response.txt", "r"); | |
fgets(output, 5, fp); | |
fclose(fp); | |
return atoi(output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment