File tree 2 files changed +2
-6
lines changed
2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,6 @@ MQ131Class::~MQ131Class() {
90
90
delay (1000 );
91
91
}
92
92
lastValueRs = readRs ();
93
- correctedLastValueRs = lastValueRs / getEnvCorrectRatio ();
94
93
stopHeater ();
95
94
}
96
95
@@ -204,13 +203,13 @@ MQ131Class::~MQ131Class() {
204
203
// Use the equation to compute the O3 concentration in ppm
205
204
// R^2 = 0.9987
206
205
// Compute the ratio Rs/R0 and apply the environmental correction
207
- ratio = correctedLastValueRs / correctedValueR0 ;
206
+ ratio = lastValueRs / valueR0 * getEnvCorrectRatio () ;
208
207
return convert ((10.66435681 * pow (ratio, 2.25889394 ) - 10.66435681 ), PPB, unit);
209
208
case HIGH_CONCENTRATION :
210
209
// Use the equation to compute the O3 concentration in ppm
211
210
// R^2 = 0.99
212
211
// Compute the ratio Rs/R0 and apply the environmental correction
213
- ratio = correctedLastValueRs / correctedValueR0 ;
212
+ ratio = lastValueRs / valueR0 * getEnvCorrectRatio () ;
214
213
return convert ((8.37768358 * pow (ratio, 2.30375446 ) - 8.37768358 ), PPM, unit);
215
214
default :
216
215
return 0.0 ;
@@ -324,7 +323,6 @@ void MQ131Class::calibrate() {
324
323
*/
325
324
void MQ131Class::setR0 (float _valueR0) {
326
325
valueR0 = _valueR0;
327
- correctedValueR0 = _valueR0 / getEnvCorrectRatio ();
328
326
}
329
327
330
328
/* *
Original file line number Diff line number Diff line change @@ -123,11 +123,9 @@ class MQ131Class {
123
123
124
124
// Calibration of R0
125
125
float valueR0 = -1 ;
126
- float correctedValueR0 = -1 ;
127
126
128
127
// Last value for sensor resistance
129
128
float lastValueRs = -1 ;
130
- float correctedLastValueRs = -1 ;
131
129
132
130
// Parameters for environment
133
131
int8_t temperatureCelsuis = MQ131_DEFAULT_TEMPERATURE_CELSIUS;
You can’t perform that action at this time.
0 commit comments