add atmp_compensated and rhum_compensated to sync data

This commit is contained in:
Phat Nguyen
2024-04-13 20:39:05 +07:00
parent 25ef1ced9e
commit e1115659e2
4 changed files with 44 additions and 2 deletions

View File

@ -201,3 +201,19 @@ void PMS5003T::handle(void) { pms.handle(); }
* @return false Communication timeout or sensor has removed
*/
bool PMS5003T::isFailed(void) { return pms.isFailed(); }
float PMS5003T::temperatureCompensated(float temp) {
if (temp < 10.0f) {
return temp * 1.327f - 6.738f;
}
return temp * 1.181f - 5.113f;
}
float PMS5003T::humidityCompensated(float hum) {
hum = hum * 1.259f + 7.34f;
if (hum > 100.0f) {
hum = 100.0f;
}
return hum;
}