-
Why are the battery volt limits for 0-100 between these 2 numbers?
Because analog input can take only up to 3.3v and battery is up to 4.2V so there must be some resistor divider to reduce voltage below 3.3V. Resistors were chosen 'randomly' by manufacturer for this design so no reason to multiply by 3.3. Across some fitness trackers I've seen the value varied a lot for each manufacturer/device model.
Was this code aimed for a more weared down battery?
individual resistor tolerancies can be even few % see e.g. https://www.electronics-tutorials.ws/resistor/res_2.html , can make some difference in the voltage divider for each device
after reading http://forum.espruino.com/conversations/350764/ , i did some digging and have some questions.
The pin used for voltage reading is pin 30. I used :
after it being fully charged and got the value : 0.63110351562
from jswrap_bangle.c. Notice the upper and lower limits hard coded into the formula.
Was this code aimed for a more weared down battery? average use case?
I'm thinking to use analogRead instead of E.getBattery. Is this a good idea?
Edit: I also discovered E.getAnalogVRef() which outputted a number close to 3.3 v
So ... 0.51 * 3.3V = 1.683V
and 0.62 * 3.3V = 2.046V
Why are the battery volt limits for 0-100 between these 2 numbers?