TinyCircuits / TinyCircuits-Thumby-Code-Editor

https://code.thumby.us/
GNU General Public License v3.0
28 stars 19 forks source link

Thumby battery indicator #110

Closed UnRedKnown closed 3 months ago

UnRedKnown commented 3 months ago

Pull request renewed with working and updated menu.py file

masonova1 commented 3 months ago

It's hard to tell where the magic numbers come from here, and whether they would hold across Thumby hardware units. Also, I would prefer to calculate the percentage as a quantized range between some maximum and minimum in increments of 5%... This would look like percentage = 5*floor(20*(current battery level) / (max level - min level)), instead of a very long elif train. But because max and min level changes from device to device, these are hard to standardize.