Move network management stuff to own class
This commit is contained in:
parent
a3068a2d15
commit
20d0263812
5 changed files with 110 additions and 60 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <OneWire.h>
|
||||
#include <DallasTemperature.h>
|
||||
#include <PubSubClient.h>
|
||||
#include "Networking.h"
|
||||
|
||||
#define PH_7_VOLTAGE 2.5
|
||||
#define PH_4_VOLTAGE 3.04
|
||||
|
@ -17,10 +18,10 @@ class Sensors {
|
|||
float _pHStep = (PH_7_VOLTAGE - PH_4_VOLTAGE) / 3;
|
||||
Adafruit_ADS1115 _ads;
|
||||
DallasTemperature _ds18b20;
|
||||
PubSubClient _mqttClient;
|
||||
Networking* _networking;
|
||||
|
||||
public:
|
||||
Sensors(int temperaturePin, char *temperatureTopic, char *phTopic, PubSubClient mqttClient);
|
||||
Sensors(int temperaturePin, char *temperatureTopic, char *phTopic, Networking* networking);
|
||||
void setup();
|
||||
float readpH();
|
||||
void publishpH();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue