You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some testing, when the switch statement for battery % calculation uses this formula:
9412 - 23449*(v/batteries) + 19240*(vv/batteries) - 5176(vvv/batteries)
It does not seem to work properly and can return a -ve value. Fix this to work!
The text was updated successfully, but these errors were encountered:
New code for calculation released to development branch based on the values above:
let v = msg[key]/batteries;
let charge = 0;
if (v >= 1.55){
charge = 100;
} else if (v < 1.1 ){
charge = 0
} else if (v < 1.18 ){
charge = 5;
} else {
// use a simple linear equation for the rest (y=mx+c), based on 1.44v=90% and 1.2v=10%
charge = (333.3*v) - 390;
}
After some testing, when the switch statement for battery % calculation uses this formula:
9412 - 23449*(v/batteries) + 19240*(vv/batteries) - 5176(vvv/batteries)
It does not seem to work properly and can return a -ve value. Fix this to work!
The text was updated successfully, but these errors were encountered: