We can get Battery percentage in Blocks but does anyone know how that converts to volts?
0% is 6V or less.
100% 8V or above
I guess I could experiment to find out, but is it linear between the two? 50% is 7V? 75% is 7.5V?
All we know about the IQ battery is voltage, there is a direct sdk call for that, but the blocks team chose to expose capacity which IMHO is sort of useless unless used very superficially. The relatioship is linear, the code looks like this (volts is a float)
int16_t capacity = 100 * (volts - 6) / 2; if( capacity < 0 ) capacity = 0; if( capacity > 100 ) capacity = 100;
One last question… Is the percentage in “device info” calculated the same way?
Thanks for all the insights!
Hm, actually no, written some years apart by different developers.
The brain screen uses 6.3V and 8.2V as the thresholds, still linear though, I should probably adjust the sdk so they are both the same.