Tweet

Replying to @willianpaixaoo

A battery percentage might be hard, but a low battery warning is already there! The SAM L22 has a configurable brownout detector; I’m using it to detect when the battery voltage dips below 2.5 V, which sets a flag indicating that it’s on its last legs.

(original)