mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-06 08:36:15 +00:00
Cleanup and fix bugs found during testing
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user