-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix print log message number format #223
Conversation
@@ -1051,7 +1051,7 @@ static void updatePm(void) { | |||
Serial.printf("[1] Relative Humidity: %d\r\n", measurements.hum_1); | |||
Serial.printf("[1] Temperature compensated in C: %0.2f\r\n", | |||
ag->pms5003t_1.temperatureCompensated(measurements.temp_1)); | |||
Serial.printf("[1] Relative Humidity compensated: %f\r\n", | |||
Serial.printf("[1] Relative Humidity compensated: %0.2f\r\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The methods below should be renamed to compensateTemp / compensateHum and also documented. I mean we need to explain what the formula is, maybe link to some external document
float PMS5003TBase::temperatureCompensated(float temp) {
if (temp < 10.0f) {
return temp * 1.327f - 6.738f;
}
return temp * 1.181f - 5.113f;
}
float PMS5003TBase::humidityCompensated(float hum) {
hum = hum * 1.259f + 7.34f;
if (hum > 100.0f) {
hum = 100.0f;
}
return hum;
}
float PMS5003TBase::temperatureCompensated(float temp) {
if (temp < 10.0f) {
return temp * 1.327f - 6.738f;
}
return temp * 1.181f - 5.113f;
}
float PMS5003TBase::humidityCompensated(float hum) {
hum = hum * 1.259f + 7.34f;
if (hum > 100.0f) {
hum = 100.0f;
}
return hum;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The methods below should be renamed to compensateTemp / compensateHum and also documented. I mean we need to explain what the formula is, maybe link to some external document
@nick-4711 OK
@airgradienthq Can you provide the link document for the formula.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ensated` to `compensateHum`
Correct print log message number format, #218