18 ms·
No problem. I haven’t had a chance to do anything hardware related for a long time, so it’s fun to think about hardware problems again. On the topic of extendi
by coder543 2y ago
No problem. I haven’t had a chance to do anything hardware related for a long time, so it’s fun to think about hardware problems again.
On the topic of extending battery life mentioned in the article, one relatively straightforward thing to investigate is simply reducing the processor clock speed. Your application probably doesn’t need to run at full tilt. I think there is a function called setCpuFrequencyMhz — I think it only works with a few specific frequencies, but the lower the frequency you can pick (while still keeping up with your application’s needs), the less power the system should consume while awake.
Of course, you want to be putting the processor to sleep between updates anyways, and there is a trade off between sleeping more (which means running the processor faster so it can sleep sooner, “race to sleep”), versus the inefficiency caused by running a processor higher on the frequency/efficiency curve, so there might be an optimal frequency that isn’t the lowest or the highest possible option. It’s something that would need to be measured.
Just some thoughts! It might not make a big difference if the processor is already sleeping most of the time, but I figured I would mention it as something to try.