Reading battery level from mmbasic

Has anyone managed to use the i2c commands in PicoMite to get that battery register value? Or is that really not possible in MMBasic? I’ve tried a few things, but I’m not sure I really understand how to use the i2c commands properly.

If it’s not possible with MMBasic itself, maybe I could look into adding a custom command to PicoMite (for PicoCalc only) to get the battery value and pass it through based on guu’s code here. I imagine the same could be done for setting the backlight as well. Actually, that’s something I’d personally use more, as I find it annoying to have to always turn the keyboard backlight on and it would be nice if it was saved (as an OPTION?) and always used the last saved value on startup. I’ll add it to my todo/wish list. :wink:

Just to follow up… Forgot about this thread, but saw it linked from discord today.

It’s possible to get battery info from MMBasic now, with the most recent releases. (It went in for RC21, but is still there for RC23 and whatever I end up releasing next.) :slight_smile: A number of other bugs have been fixed (like keyboard handling), and this contains the latest from the mainline MMBasic releases as well.

You’ll need to update your keyboard firmware though, but more information on that is provided in the release notes. Here’s a screenshot showing the new commands, for reference.

3 Likes

I defined F9 key to show the batt info, very practical !

1 Like

I put a battery bar/line on the right side. Extra practical :laughing:
Though it’s micropython…

4 Likes