Move network management stuff to own class

This commit is contained in:
Robert Marshall 2018-10-07 16:09:43 +01:00
parent a3068a2d15
commit 20d0263812
5 changed files with 110 additions and 60 deletions

View file

@ -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();