Skip to content

Commit

Permalink
Set SCD4x to not read until T+5s
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Nov 7, 2024
1 parent cdb4d02 commit b4c83b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/i2c/drivers/WipperSnapper_I2C_Driver_SCD4X.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class WipperSnapper_I2C_Driver_SCD4X : public WipperSnapper_I2C_Driver {
return false;
}

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

Expand Down

0 comments on commit b4c83b8

Please sign in to comment.