1
0
Fork 0

gpstrek - Reconstruct battery voltage using calibrated value

master
Martin Boonk 2022-11-02 00:31:06 +01:00
parent b7a532e16d
commit fff2e41874
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,8 @@
{ //run in own scope for fast switch
const STORAGE = require("Storage");
const BAT_FULL = require("Storage").readJSON("setting.json").batFullVoltage || 0.3144;
let init = function(){
global.screen = 1;
global.drawTimeout = undefined;
@ -815,7 +817,7 @@ let healthSlice = getDoubleLineSlice("Heart","Steps",()=>{
});
let system2Slice = getDoubleLineSlice("Bat","",()=>{
return (Bangle.isCharging()?"+":"") + E.getBattery().toFixed(0)+"% " + NRF.getBattery().toFixed(2) + "V";
return (Bangle.isCharging()?"+":"") + E.getBattery().toFixed(0)+"% " + (analogRead(D3)*4.2/BAT_FULL).toFixed(2) + "V";
},()=>{
return "";
});