Commit 88e1e8ab authored by Dmitry Frolov's avatar Dmitry Frolov

Fix formula in getResistance(): 5.0 is unnecessary here

parent a9c0e645
......@@ -52,7 +52,7 @@ float MQ135::getCorrectionFactor(float t, float h) {
/**************************************************************************/
float MQ135::getResistance() {
int val = analogRead(_pin);
return ((1023./(float)val) * 5. - 1.)*RLOAD;
return ((1023./(float)val) - 1.)*RLOAD;
}
/**************************************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment