|
|
|
|
|
by anigbrowl
1250 days ago
|
|
I got into ESP32 hacking a few months back, and I'm glad I happened to start with a battery-powered device (an M5stack StickC) because it imposed this awareness very early - the device has an internal battery, but it's only good for about half an hour running flat out. So after building a little wifi detector the first patch was adding a battery meter and an auto-dimmer to save a few mAh. Now every project starts out with some ideas about what I'd like the device to do, followed by questions about how much temporal resolution I really need, when and how to dump or store data etc. as well as the more obvious constraints of tiny memory and storage capacity. It's...kinda fun? Perhaps more so as I only have to please myself rather than an employer or client. You can just query the ESP32 about battery voltage/current/charge state/temperature which of course makes things very easy. On the assumption that specifications and quality vary a lot and that voltage doesn't fall off in a convenient linear fashion, I've just been experimenting with it like any other environmental variable to decide between performance, economy, or panic modes. |
|
Set it up to wake from sleep on some interrupt, do your processing, then go back to sleep. You can setup a timer interrupt to wake periodically to do processing as well.