|
@ -78,7 +78,7 @@ class MHZ19Sensor : public BaseSensor { |
|
|
_serial = new SoftwareSerial(_pin_rx, _pin_tx, false, 32); |
|
|
_serial = new SoftwareSerial(_pin_rx, _pin_tx, false, 32); |
|
|
_serial->enableIntTx(false); |
|
|
_serial->enableIntTx(false); |
|
|
_serial->begin(9600); |
|
|
_serial->begin(9600); |
|
|
calibrateAuto(false); |
|
|
|
|
|
|
|
|
calibrateAuto(_calibrateAuto); |
|
|
|
|
|
|
|
|
_ready = true; |
|
|
_ready = true; |
|
|
_dirty = false; |
|
|
_dirty = false; |
|
@ -139,6 +139,13 @@ class MHZ19Sensor : public BaseSensor { |
|
|
_write(buffer); |
|
|
_write(buffer); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void setCalibrateAuto(boolean value) { |
|
|
|
|
|
_calibrateAuto = value; |
|
|
|
|
|
if (_ready) { |
|
|
|
|
|
calibrateAuto(value); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected: |
|
|
protected: |
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------- |
|
|
// --------------------------------------------------------------------- |
|
@ -214,6 +221,7 @@ class MHZ19Sensor : public BaseSensor { |
|
|
double _co2 = 0; |
|
|
double _co2 = 0; |
|
|
unsigned int _pin_rx; |
|
|
unsigned int _pin_rx; |
|
|
unsigned int _pin_tx; |
|
|
unsigned int _pin_tx; |
|
|
|
|
|
bool _calibrateAuto = false; |
|
|
SoftwareSerial * _serial = NULL; |
|
|
SoftwareSerial * _serial = NULL; |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|