Merge pull request #42 from ArnieO/dev-v1.1.0

Dev v1.1.0 Optional ESP8266 Vcc calibration factor in *.ini file
This commit is contained in:
Gunnar Skjold 2020-03-01 12:53:56 +01:00 committed by GitHub
commit 1a2e70b1fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,11 @@ double HwTools::getVcc() {
#if defined(ARDUINO_ESP8266_WEMOS_D1MINI)
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;
#if defined(ESP_VCC_CALIB_FACTOR)
return ((double) ESP.getVcc()) / 1024 * ESP_VCC_CALIB_FACTOR;
#else
return ((double) ESP.getVcc()) / 1024;
#endif
#endif
return -1;
}