Skip to content

Commit

Permalink
add link to formula documents
Browse files Browse the repository at this point in the history
  • Loading branch information
pnt325 committed Aug 30, 2024
1 parent 28d27ee commit 244b781
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/PMS/PMS5003TBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,29 @@ PMS5003TBase::PMS5003TBase() {}

PMS5003TBase::~PMS5003TBase() {}

/**
* @brief Compensate the temperature
*
* Reference formula: https://www.airgradient.com/documentation/correction-algorithms/
*
* @param temp
* @return * float
*/
float PMS5003TBase::compensateTemp(float temp) {
if (temp < 10.0f) {
return temp * 1.327f - 6.738f;
}
return temp * 1.181f - 5.113f;
}

/**
* @brief Compensate the humidity
*
* Reference formula: https://www.airgradient.com/documentation/correction-algorithms/
*
* @param temp
* @return * float
*/
float PMS5003TBase::compensateHum(float hum) {
hum = hum * 1.259f + 7.34f;

Expand Down

0 comments on commit 244b781

Please sign in to comment.