mirror of
https://github.com/sigmasternchen/MH-Z-CO2-Sensors
synced 2025-03-15 06:38:55 +00:00
Move global variables to class atributes to make it possible to define 2 sensors running independantly (#20)
This commit is contained in:
parent
8a063e7c27
commit
d2dbf58947
2 changed files with 5 additions and 5 deletions
5
MHZ.cpp
5
MHZ.cpp
|
@ -24,11 +24,6 @@ const int STATUS_NOT_READY = -5;
|
|||
const int STATUS_PWM_NOT_CONFIGURED = -6;
|
||||
const int STATUS_SERIAL_NOT_CONFIGURED = -7;
|
||||
|
||||
unsigned long lastRequest = 0;
|
||||
|
||||
bool SerialConfigured = true;
|
||||
bool PwmConfigured = true;
|
||||
|
||||
MHZ::MHZ(uint8_t rxpin, uint8_t txpin, uint8_t pwmpin, uint8_t type) {
|
||||
SoftwareSerial * ss = new SoftwareSerial(rxpin, txpin);
|
||||
_pwmpin = pwmpin;
|
||||
|
|
5
MHZ.h
5
MHZ.h
|
@ -52,6 +52,11 @@ class MHZ {
|
|||
|
||||
Stream * _serial;
|
||||
byte getCheckSum(byte *packet);
|
||||
|
||||
unsigned long lastRequest = 0;
|
||||
|
||||
bool SerialConfigured = true;
|
||||
bool PwmConfigured = true;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue