mirror of
https://github.com/sigmasternchen/MH-Z-CO2-Sensors
synced 2025-03-15 06:38:55 +00:00
Debug info and temperature update
Prevent "...Status maybe not OK.." from always being printed when debug is on. Changed the is !isReady check to isPreHeating when getting the latest temperature. The isReady check prevents the function from returing the pre stored temperature within MHZxxx_RESPONSE_TIME after the UART data has been requested. This is an unnecessary restriction.
This commit is contained in:
parent
4d8878bde4
commit
f96cf2abc6
1 changed files with 2 additions and 2 deletions
4
MHZ.cpp
4
MHZ.cpp
|
@ -153,7 +153,7 @@ int MHZ::readCO2UART() {
|
|||
|
||||
// Is always 0 for version 14a and 19b
|
||||
// Version 19a?: status != 0x40
|
||||
if (debug || status != 0) {
|
||||
if (debug && status != 0) {
|
||||
Serial.print(F(" ! Status maybe not OK ! "));
|
||||
Serial.println(status, HEX);
|
||||
} else if (debug) {
|
||||
|
@ -166,7 +166,7 @@ int MHZ::readCO2UART() {
|
|||
}
|
||||
|
||||
uint8_t MHZ::getLastTemperature() {
|
||||
if (!isReady()) return STATUS_NOT_READY;
|
||||
if (isPreHeating()) return STATUS_NOT_READY;
|
||||
return temperature;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue