Skip to content

Clear battery cache in ShowBattery app#37

Merged
ThomasFarstrike merged 1 commit intoMicroPythonOS:mainfrom
jedie:clear-battery-cache
Feb 14, 2026
Merged

Clear battery cache in ShowBattery app#37
ThomasFarstrike merged 1 commit intoMicroPythonOS:mainfrom
jedie:clear-battery-cache

Conversation

@jedie
Copy link
Copy Markdown
Contributor

@jedie jedie commented Feb 13, 2026

Add a "Real-time values" checkbox to ShowBattery app. If checked, then the cache will be clear on
every cycle.

Bugfix: Use mpos.time.localtime() to get the "correct" local time with timezone offset.

Changes for Odroid-GO:

The seen "2400" values are at startup the Odroid-GO... After a while the values are somewhere
between 290 and 310... The full range is unknown, yet. But with the new calculation it looks more
realistic, then before ;)

Looks like:

grafik

@ThomasFarstrike
Copy link
Copy Markdown
Contributor

ThomasFarstrike commented Feb 13, 2026

It's nice, but the only issue here is that ADC2 for battery measurement and wifi don't work at the same time, so with this change, boards that use ADC2 will lose wifi connection, plus the automatic wifi reconnect will use quite a bit more power, so it has an impact.

I guess that might be okay, depending on what you're testing, but maybe it should be an option (checkbox) so that the user can choose whether they want the "live" value or the "cached" value?

@jedie
Copy link
Copy Markdown
Contributor Author

jedie commented Feb 13, 2026

Yes a checkbox would be nice. Will see if i can do it...
I will also add the "raw value" to the screen. Will help to calibrate ;)

@jedie jedie force-pushed the clear-battery-cache branch 2 times, most recently from 7ae8580 to ce9d580 Compare February 14, 2026 16:14
Add a "Real-time values" checkbox to ShowBattery app. If checked, then the cache will be clear on
every cycle.

Bugfix: Use `mpos.time.localtime()` to get the "correct" local time with timezone offset.

Changes for Odroid-GO:

The seen "2400" values are at startup the Odroid-GO... After a while the values are somewhere
between 270 and 310... The full range is unknown, yet. But with the new calculation it looks more
realistic, then before ;)
@jedie jedie force-pushed the clear-battery-cache branch from ce9d580 to ac89237 Compare February 14, 2026 16:20
@ThomasFarstrike ThomasFarstrike merged commit 60fcf64 into MicroPythonOS:main Feb 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants