mirror of
https://github.com/sigmasternchen/MH-Z-CO2-Sensors
synced 2025-03-15 06:38:55 +00:00
Extracted response times.
This commit is contained in:
parent
83ba964a90
commit
252266c130
1 changed files with 5 additions and 2 deletions
7
MHZ.cpp
7
MHZ.cpp
|
@ -8,6 +8,9 @@
|
|||
const int MHZ14A = 14;
|
||||
const int MHZ19B = 19;
|
||||
|
||||
const int MHZ14A_RESPONSE_TIME = 60;
|
||||
const int MHZ19B_RESPONSE_TIME = 120;
|
||||
|
||||
const int STATUS_NO_RESPONSE = -2;
|
||||
const int STATUS_CHECKSUM_MISMATCH = -3;
|
||||
const int STATUS_INCOMPLETE = -4;
|
||||
|
@ -51,9 +54,9 @@ boolean MHZ::isPreHeating() {
|
|||
boolean MHZ::isReady() {
|
||||
if (isPreHeating()) return false;
|
||||
if (_type == MHZ14A)
|
||||
return lastRequest < millis() - 90 * 1000;
|
||||
return lastRequest < millis() - MHZ14A_RESPONSE_TIME;
|
||||
else if (_type == MHZ19B)
|
||||
return lastRequest < millis() - 60 * 1000;
|
||||
return lastRequest < millis() - MHZ19B_RESPONSE_TIME;
|
||||
else {
|
||||
Serial.print("MHZ::isReady() => UNKNOWN SENSOR \"");
|
||||
Serial.print(_type);
|
||||
|
|
Loading…
Reference in a new issue