28 lines
No EOL
624 B
C++
28 lines
No EOL
624 B
C++
#ifndef Sensors_h
|
|
#define Sensors_h
|
|
#include <Wire.h>
|
|
#include <Adafruit_ADS1015.h>
|
|
#include <OneWire.h>
|
|
#include <DallasTemperature.h>
|
|
#include <PubSubClient.h>
|
|
#include "Networking.h"
|
|
|
|
#define PH_7_VOLTAGE 2.5
|
|
#define PH_4_VOLTAGE 3.04
|
|
#define VOLTAGE_OFFSET 0.03
|
|
|
|
class Sensors {
|
|
int _temperaturePin;
|
|
float _pHStep = (PH_7_VOLTAGE - PH_4_VOLTAGE) / 3;
|
|
Adafruit_ADS1115 _ads;
|
|
DallasTemperature* _ds18b20;
|
|
Networking *_networking;
|
|
|
|
public:
|
|
Sensors(int temperaturePin, Networking *networking, DallasTemperature* ds18b20);
|
|
void setup();
|
|
float readpH();
|
|
const char *getpH();
|
|
const char *getTemperature();
|
|
};
|
|
#endif |