make bat voltage sensing work on eink

This commit is contained in:
geeksville
2020-09-26 18:13:16 -07:00
parent 956d9e96f2
commit 28ec0e310d
3 changed files with 9 additions and 12 deletions

View File

@@ -66,7 +66,10 @@ bool Power::analogInit()
{
#ifdef BATTERY_PIN
DEBUG_MSG("Using analog input for battery level\n");
#ifndef NO_ESP32
// ESP32 needs special analog stuff
adcAttachPin(BATTERY_PIN);
#endif
// adcStart(BATTERY_PIN);
analogReadResolution(10); // Default of 12 is not very linear. Recommended to use 10 or 11 depending on needed resolution.
batteryLevel = &analogLevel;