Skip to content

Instantly share code, notes, and snippets.

@brian-lc
Created December 7, 2016 03:18
Show Gist options
  • Save brian-lc/4497899d1ecf07391980de75fce68f7a to your computer and use it in GitHub Desktop.
Save brian-lc/4497899d1ecf07391980de75fce68f7a to your computer and use it in GitHub Desktop.
#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