diff --git a/co2_sensor.cpp b/co2_sensor.cpp index f800bd25cf3c9ec882e002e5e04c8d0e8e3ebf14..a51036a1fcf2b445da005988469d2d9d9f923e63 100644 --- a/co2_sensor.cpp +++ b/co2_sensor.cpp @@ -84,6 +84,8 @@ namespace sensor { static int16_t previous_co2 = 0; if (co2 > (previous_co2 - 30) && co2 < (previous_co2 + 30)) { stable_measurements++; + Serial.print("Stable since : "); + Serial.println(stable_measurements); waiting_color = color::green; } else { stable_measurements = 0; @@ -142,7 +144,9 @@ namespace sensor { * Fresh data. Show it and send it if needed. */ if (freshData) { - countStableMeasurements(); + if (should_calibrate) { + countStableMeasurements(); + } timestamp = ntp::getLocalTime(); Serial.println(timestamp);