edit:
if (mv < 3500) { //still above 3300 so no ADC issues
//TODO shutdown what you started
digitalWrite(PD3, 0); //disable VBAT to ADC switch
//beware not all pins work, you might need C0 escape_hatch (4 didn’t work)
LowPower.attachInterruptWakeup(5, nullptr, FALLING);
LowPower.deepSleepMemoryWrite(0, saved_variable);
LowPower.deepSleep(); //this resets the board when waking
}
ACCU-ICR14500.pdf.zip (908.6 KB)
From this datasheet even 3v3 is close to discharged, I’m using about 200mA max so 3v5 is a good shutdown point. Also a form of overcurrent protection to prevent 3A draining the battery too fast extending battery lifetime.
In the other thread it was way at the bottom of the discussion and somewhat harder to see.
So I put this one in the solutions forum and just left it as an answer.
This method uses the default AD converter settings, Vref=3.3V(VDD), analogGain=1. With this method, battery voltage cannot be measured in the range of approximately 3.4V or lower.
To measure down to the range below 3.4V is discussed in the following link