H
Hi @MauriceX111 I've also just got an M5 Paper v1.1 (my first experience of M5 or ESP32) and it is a very nice product but I'm also struggling to find out things... Very grateful that this community - and especially @felmue - are here, otherwise I'd be completely stuck!
Felix pointed me at the code that the device ships with.
Searching this, I found here the following code
// Battery
_bar->setTextDatum(CR_DATUM);
_bar->pushImage(498, 8, 32, 32, ImageResource_status_bar_battery_32x32);
uint32_t vol = M5.getBatteryVoltage();
if (vol < 3300) {
vol = 3300;
} else if (vol > 4350) {
vol = 4350;
}
float battery = (float)(vol - 3300) / (float)(4350 - 3300);
if (battery <= 0.01) {
battery = 0.01;
}
if (battery > 1) {
battery = 1;
}
uint8_t px = battery * 25;
sprintf(buf, "%d%%", (int)(battery * 100));
// _bar->drawString(buf, 498 - 10, 27);
_bar->fillRect(498 + 3, 8 + 10, px, 13, 15);
So that doesn't help with finding out whether the battery is charging; but it does seem to be the best available way to represent the charge level.
HTH.