Cleanup and fix bugs found during testing

This commit is contained in:
Gunnar Skjold
2020-02-15 22:13:04 +01:00
parent 9c09740a41
commit f6066fbbf3
6 changed files with 49 additions and 11 deletions

View File

@@ -12,16 +12,24 @@
#include <DallasTemperature.h>
#include <OneWire.h>
#if HW_ROARFRED
#define TEMP_SENSOR_PIN 5
#elif defined(ARDUINO_LOLIN_D32)
#define TEMP_SENSOR_PIN 14
#elif defined(ARDUINO_ESP8266_WEMOS_D1MINI)
#define TEMP_SENSOR_PIN D5
#endif
class HwTools {
public:
static double getVcc();
static double getTemperature();
double getVcc();
double getTemperature();
HwTools() {
#if defined TEMP_SENSOR_PIN
oneWire = new OneWire(TEMP_SENSOR_PIN);
tempSensor = new DallasTemperature(this->oneWire);
#endif
};
private:
bool tempSensorInit, hasTempSensor;