Created
December 14, 2017 20:12
-
-
Save sidwarkd/864b088568f7ad41f0f98e7aaada3770 to your computer and use it in GitHub Desktop.
Sleep Examples for Particle Photon
This file contains hidden or 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
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()"); | |
} |
This file contains hidden or 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
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()"); | |
} |
This file contains hidden or 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
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