Skip to content

Instantly share code, notes, and snippets.

@mrichardson23
Created January 22, 2014 12:36
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 mrichardson23/8558011 to your computer and use it in GitHub Desktop.
Save mrichardson23/8558011 to your computer and use it in GitHub Desktop.
int from server to Galileo
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