Skip to content

Commit b4c83b8

Browse files
committed
Set SCD4x to not read until T+5s
1 parent cdb4d02 commit b4c83b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_SCD4X.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ class WipperSnapper_I2C_Driver_SCD4X : public WipperSnapper_I2C_Driver {
6464
return false;
6565
}
6666

67+
// Takes 5seconds to have data ready, don't queue read until then
68+
ulong currentTime = millis() - 25000uL; // T-25s, so 5s time for 30s polling
69+
this->setSensorCO2PeriodPrv(currentTime);
70+
this->setSensorAmbientTempFPeriodPrv(currentTime);
71+
this->setSensorAmbientTempPeriodPrv(currentTime);
72+
this->setSensorRelativeHumidityPeriodPrv(currentTime);
6773
return true;
6874
}
6975

0 commit comments

Comments
 (0)