Skip to content
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

Merged
merged 6 commits into from
Sep 2, 2024

Conversation

pnt325
Copy link
Collaborator

@pnt325 pnt325 commented Aug 25, 2024

Correct print log message number format, #218

@@ -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",
Copy link
Collaborator

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;
}

Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pnt325 pnt325 requested a review from nick-4711 August 28, 2024 02:58
@airgradienthq airgradienthq merged commit 8b0fe96 into develop Sep 2, 2024
20 checks passed
@pnt325 pnt325 deleted the hotfix/print-log-wrong-format branch September 2, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants