Created
October 31, 2015 08:48
-
-
Save suzukiken/0a432167040107bf4a5c to your computer and use it in GitHub Desktop.
ThingShadowEcho.ino additional code.
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
// print Count and Time | |
int cntst = delta.indexOf("\"Count\":"); | |
if (cntst != -1) { | |
cntst += strlen("\"Count\":"); | |
int cnted = delta.indexOf(","); | |
if (cnted == -1) { | |
cnted = delta.indexOf("}"); | |
} | |
String cnt = delta.substring(cntst, cnted); | |
Serial.println("Count: " + cnt); | |
} | |
int timst = delta.indexOf("\"Time\":\""); | |
if (timst != -1) { | |
timst += strlen("\"Time\":\""); | |
int timed = delta.indexOf("\"}"); | |
String tim = delta.substring(timst, timed); | |
Serial.println("Time: " + tim); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment