mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-03-06 11:33:38 +00:00
Cleanup and fix bugs found during testing
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
#include "HwTools.h"
|
||||
|
||||
|
||||
double HwTools::getVcc() {
|
||||
#if defined(ARDUINO_ESP8266_WEMOS_D1MINI)
|
||||
return (((double) ESP.getVcc()) / 1024) * 1.1; // This board has a voltage divider on VCC, add 10%
|
||||
return (((double) ESP.getVcc()) / 900); // This board has a voltage divider on VCC. Yes, 900 is correct
|
||||
#elif defined(ESP8266)
|
||||
return ((double) ESP.getVcc()) / 1024;
|
||||
#endif
|
||||
@@ -15,7 +14,7 @@ double HwTools::getTemperature() {
|
||||
#if defined TEMP_SENSOR_PIN
|
||||
if(!tempSensorInit) {
|
||||
tempSensor->begin();
|
||||
delay(25);
|
||||
delay(50);
|
||||
tempSensor->requestTemperatures();
|
||||
hasTempSensor = tempSensor->getTempCByIndex(0) != DEVICE_DISCONNECTED_C;
|
||||
tempSensorInit = true;
|
||||
|
||||
Reference in New Issue
Block a user