Created
December 7, 2016 03:18
-
-
Save brian-lc/4497899d1ecf07391980de75fce68f7a to your computer and use it in GitHub Desktop.
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
#define DEFAULT_SLEEP = 1000; //number of seconds of slee. | |
class ParticleInfo { | |
public: | |
String deviceID; | |
long sleepTime; | |
ParticleInfo(long sleep){ | |
sleepTime = sleep; | |
} | |
void deepSleep(){ | |
System.sleep(SLEEP_MODE_DEEP, sleepTime); | |
} | |
String getTime(){ | |
time_t time = Time.now(); | |
Time.zone(0); // setup a time zone, which is part of the ISO6801 format | |
String fmTime = Time.format(time, TIME_FORMAT_ISO8601_FULL); // 2004-01-10T08:22:04-05:15 | |
return(fmTime); | |
} | |
bool resolutionCheck(){ | |
IPAddress ip; | |
void setup() { | |
ip = WiFi.resolve("www.google.com"); | |
if(ip) { | |
// IP address was resolved | |
return true; | |
} else { | |
// name resolution failed | |
return false; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment