Skip to content

Instantly share code, notes, and snippets.

@mrichardson23
Created January 22, 2014 12:36
Show Gist options
  • 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