From 2d02b9ef88e4cf1374102146829ec2e816e28f02 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Mon, 27 Jan 2025 15:54:23 +0100 Subject: Battery measurement on the ESP32-C3-DevKit-Lipo --- source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst b/source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst index caec10e..2a6b14c 100644 --- a/source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst +++ b/source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst @@ -38,11 +38,21 @@ These are the settings used: It may be necessary to bring GPIO9 to GND to force the board into bootloader mode before loading sketches. +Battery Measurement +=================== + +The battery voltage can be read on GPIO3 after closing the jumpers +BAT_PWR_E1 and BAT_SENS_E1 with the following arduino code:: + + float battValue = analogReadMilliVolts(3) / 500.0 ; + See also ======== * `The post on my blog with the original version of these instructions `_ +* `Explanation on battery measurements in a GitHub issue + `_ .. vim: set filetype=rst: -- cgit v1.2.3