Browse Source

Fix formula in getResistance(): 5.0 is unnecessary here

master
Dmitry Frolov 6 years ago
parent
commit
88e1e8abc2
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      MQ135.cpp

+ 1
- 1
MQ135.cpp View File

@ -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;
}
/**************************************************************************/


Loading…
Cancel
Save