* T1000e battery measure fix

This commit is contained in:
Scott Powell
2025-03-08 20:18:15 +11:00
parent 5acfe52417
commit 9b5a294695
+5
View File
@@ -31,8 +31,13 @@ public:
uint16_t getBattMilliVolts() override {
#ifdef BATTERY_PIN
analogReference(AR_INTERNAL_3_0);
analogReadResolution(12);
float volts = (analogRead(BATTERY_PIN) * ADC_MULTIPLIER * AREF_VOLTAGE) / 4096;
analogReference(AR_DEFAULT); // put back to default
analogReadResolution(10);
return volts * 1000;
#else
return 0;