-
Notifications
You must be signed in to change notification settings - Fork 130
correct pm2.5 formula to show value on display #212
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
Conversation
src/AgOledDisplay.cpp
Outdated
@@ -304,6 +304,10 @@ void OledDisplay::showDashboard(const char *status) { | |||
DISP()->drawStr(55, 27, "PM2.5"); | |||
|
|||
/** Draw PM2.5 value */ | |||
int pm25 = value.pm25_1; | |||
if (config.hasSensorSHT) { | |||
pm25 = ag->pms5003.pm25Compensated(pm25, value.Humidity); |
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.
propose to rename the method to simply .compensate(). We can see from the params that this is related to pm25.
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.
Ok, I'll change the name and update API comment to mention the input is PM2.5
src/PMS/PMS.cpp
Outdated
* | ||
* @param pm25 Raw PM2.5 value | ||
* @param humidity Humidity value (%) | ||
* @return float |
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.
it returns an int? Propose to write
@return the compensated PM2.5 value
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.
Yes, it's return the int. I'll update the method comment
* @return float | ||
*/ | ||
int PMSBase::pm25Compensated(int pm25, float humidity) { | ||
float value; |
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.
We need to link to the documentation where this is from
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.
@airgradienthq please add your document for this formula.
Update the PM2.5 calculate formula #182 . The correct value show on device display or use on local only.