Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sleep Examples for Particle Photon
void setup() {
Serial.begin(9600);
Serial.println("Running setup code");
}
void loop() {
// Do some stuff here like read a sensor
Serial.println("Start sensor read");
delay(3000);
Serial.println("End sensor read");
// Done doing stuff so go to sleep
Serial.println("Going to sleep");
//System.sleep(5);
System.sleep(SLEEP_MODE_DEEP,5);
//System.sleep(D0,RISING,5);
Serial.println("End of loop()");
}
void setup() {
Serial.begin(9600);
Serial.println("Running setup code");
}
void loop() {
// Do some stuff here like read a sensor
Serial.println("Start sensor read");
delay(3000);
Serial.println("End sensor read");
// Done doing stuff so go to sleep
Serial.println("Going to sleep");
//System.sleep(5);
//System.sleep(SLEEP_MODE_DEEP,5);
System.sleep(D0,RISING,5);
Serial.println("End of loop()");
}
void setup() {
Serial.begin(9600);
Serial.println("Running setup code");
}
void loop() {
// Do some stuff here like read a sensor
Serial.println("Start sensor read");
delay(3000);
Serial.println("End sensor read");
// Done doing stuff so go to sleep
Serial.println("Going to sleep");
System.sleep(5);
//System.sleep(SLEEP_MODE_DEEP,5);
//System.sleep(D0,RISING,5);
Serial.println("End of loop()");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.