From 88e1e8abc249869fd55f3a83a3703f1a0ec9b691 Mon Sep 17 00:00:00 2001 From: Dmitry Frolov Date: Wed, 8 Jul 2015 19:06:07 +0600 Subject: [PATCH] Fix formula in getResistance(): 5.0 is unnecessary here --- MQ135.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MQ135.cpp b/MQ135.cpp index 676ed31..7833088 100755 --- a/MQ135.cpp +++ b/MQ135.cpp @@ -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; } /**************************************************************************/