Move global variables to class atributes to make it possible to define 2 sensors running independantly (#20)

This commit is contained in:
4m1g0 2021-01-22 18:49:45 +01:00 committed by GitHub
parent 8a063e7c27
commit d2dbf58947
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -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
View file

@ -52,6 +52,11 @@ class MHZ {
Stream * _serial;
byte getCheckSum(byte *packet);
unsigned long lastRequest = 0;
bool SerialConfigured = true;
bool PwmConfigured = true;
};
#endif