LILYGO-T-OI icon indicating copy to clipboard operation
LILYGO-T-OI copied to clipboard

Is there a way to monitor the battery level?

Open cranefist opened this issue 3 years ago • 1 comments

Is it possible to monitor the battery level via software?

cranefist avatar Jun 25 '21 15:06 cranefist

T-OI already have voltage divider on A0 pin, so you can just use following code to get power data: float getVoltage() { float floatVoltage = 2 * 3.3 * analogRead(PIN_A0) / 1023; return floatVoltage; }

zenz avatar Jul 10 '21 06:07 zenz