Refactor Sensors to remove publish responsibility and instead return values. Add Screen class to output to OLED screen.
This commit is contained in:
parent
12e756fef1
commit
d51b140050
5 changed files with 81 additions and 27 deletions
10
sensors.h
10
sensors.h
|
@ -13,18 +13,16 @@
|
|||
|
||||
class Sensors {
|
||||
int _temperaturePin;
|
||||
char *_temperatureTopic;
|
||||
char *_phTopic;
|
||||
float _pHStep = (PH_7_VOLTAGE - PH_4_VOLTAGE) / 3;
|
||||
Adafruit_ADS1115 _ads;
|
||||
DallasTemperature* _ds18b20;
|
||||
Networking* _networking;
|
||||
Networking *_networking;
|
||||
|
||||
public:
|
||||
Sensors(int temperaturePin, char *temperatureTopic, char *phTopic, Networking *networking, DallasTemperature* ds18b20);
|
||||
Sensors(int temperaturePin, Networking *networking, DallasTemperature* ds18b20);
|
||||
void setup();
|
||||
float readpH();
|
||||
void publishpH();
|
||||
void publishTemperature();
|
||||
const char *getpH();
|
||||
const char *getTemperature();
|
||||
};
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue