Skip to content

Instantly share code, notes, and snippets.

@dmiddlecamp
Created October 31, 2016 15: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 dmiddlecamp/d32c02268bd7ffa30dfbfb94496b690f to your computer and use it in GitHub Desktop.
Save dmiddlecamp/d32c02268bd7ffa30dfbfb94496b690f to your computer and use it in GitHub Desktop.
SYSTEM_MODE(MANUAL);
unsigned int sleptAt;
bool once = true;
void setup() {
Particle.connect();
delay(8000);
//System.sleep(30);
sleptAt = millis();
WiFi.off();
}
void loop() {
unsigned int now = millis();
if (once && ((now - sleptAt) > 30000)) {
once = false;
WiFi.on();
Particle.connect();
}
delay(5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment