You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/Expert/Expert.ino
+7-8
Original file line number
Diff line number
Diff line change
@@ -21,19 +21,18 @@ void setup()
21
21
Serial.begin(PMS::BAUD_RATE);
22
22
DEBUG_OUT.begin(9600);
23
23
24
-
#ifdef DEEP_SLEEP
24
+
// Switch to passive mode.
25
+
pms.passiveMode();
26
+
27
+
// Default state after sensor power, but undefined after ESP restart e.g. by OTA flash, so we have to manually wake up the sensor for sure.
28
+
// Some logs from bootloader is sent via Serial port to the sensor after power up. This can cause invalid first read or wake up so be patient and wait for next read cycle.
25
29
pms.wakeUp();
30
+
31
+
#ifdef DEEP_SLEEP
26
32
delay(PMS_READ_DELAY);
27
33
readData();
28
34
pms.sleep();
29
35
ESP.deepSleep(PMS_READ_INTERVAL * 1000);
30
-
#else
31
-
// Default state after sensor power, but undefined after ESP restart e.g. by OTA flash, so we have to manually wake up the sensor for sure.
32
-
// Some logs from bootloader is sent via Serial port to the sensor after power up. This can cause invalid first read or wake up so be patient and wait for next read cycle.
0 commit comments