-
-
Save shivams/6212275db9a69cd2444e064715f4e9b6 to your computer and use it in GitHub Desktop.
Particle Sleep State Testing
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
#include "Particle.h" | |
SYSTEM_MODE(SEMI_AUTOMATIC); | |
SYSTEM_THREAD(ENABLED); | |
void setup() //hardware initialization. | |
{ | |
Serial.begin(9600); //enable serial port. | |
} | |
void loop() { | |
//////////////////// | |
// Stage-1 : WAKE // | |
//////////////////// | |
Serial.println("Normal State Starts"); | |
delay(16000); //16 seconds of normal state | |
Serial.println("Normal State Ends"); | |
///////////////////// | |
// STAGE-2 : SLEEP // | |
///////////////////// | |
Serial.println("Sleep begins"); | |
System.sleep(SLEEP_MODE_SOFTPOWEROFF, 16); //16 seconds of deep-sleep | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment