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

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