Skip to content

Commit 4fd0e6f

Browse files
committed
Change Expert.ino & PMS.h
1 parent 2b983b6 commit 4fd0e6f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Diff for: examples/Expert/Expert.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,18 @@ void setup()
2121
Serial.begin(PMS::BAUD_RATE);
2222
DEBUG_OUT.begin(9600);
2323

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.
2529
pms.wakeUp();
30+
31+
#ifdef DEEP_SLEEP
2632
delay(PMS_READ_DELAY);
2733
readData();
2834
pms.sleep();
2935
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.
33-
pms.wakeUp();
34-
35-
// Switch to passive mode.
36-
pms.passiveMode();
3736
#endif // DEEP_SLEEP
3837
}
3938

Diff for: src/PMS.h

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class PMS
77
{
88
public:
99
static const uint16_t SINGLE_RESPONSE_TIME = 1000;
10+
static const uint16_t TOTAL_RESPONSE_TIME = 1000 * 10;
11+
static const uint16_t STEADY_RESPONSE_TIME = 1000 * 30;
1012

1113
static const uint16_t BAUD_RATE = 9600;
1214

0 commit comments

Comments
 (0)