From 85df610a337bb15753155a34a82f38793497ccf2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 4 Dec 2020 12:47:47 -0500 Subject: [PATCH] Fix multiplier for battery voltage The battery voltage multiplier should be 3.3V, not 2.6V, because `AnalogIn` now compensates for the limited voltage range to some extent. After this fix, the battery voltage is still low by about 0.15V, but I think that's a fix to be made in `AnalogIn`, and will work on that separately. --- adafruit_magtag/peripherals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_magtag/peripherals.py b/adafruit_magtag/peripherals.py index 856976b..b37ca3e 100755 --- a/adafruit_magtag/peripherals.py +++ b/adafruit_magtag/peripherals.py @@ -83,7 +83,7 @@ def play_tone(self, frequency, duration): @property def battery(self): """Return the voltage of the battery""" - return (self._batt_monitor.value / 65535.0) * 2.6 * 2 + return (self._batt_monitor.value / 65535.0) * 3.3 * 2 @property def neopixel_disable(self):