Move common function to separate file

This commit is contained in:
Phat Nguyen
2024-04-22 16:30:57 +07:00
parent 2d96fc28c5
commit b91a3058fc
4 changed files with 38 additions and 18 deletions

View File

@ -202,18 +202,3 @@ void PMS5003T::handle(void) { pms.handle(); }
*/
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;
}