You are reading a single comment by @d3nd3-o0 and its replies. Click here to read the full conversation.
  • I am temporarily using something like this which overrides the api used by all apps and widgets:

    E.getBattery = function(){
      v = analogRead(30);
      const vlo = 0.52476562;
      const vhi = 0.63476562;
      pc = (v-vlo)*100/(vhi-vlo);
      if (pc>100) pc=100;
      if (pc<0) pc=0;
      return Math.round(pc);

    Still in the process of finding the best numbers for my device. If you want to see what numbers to use for your device (albeit the linear discharge is not accurate as Gordon mentioned elsewhere), you can dump it onto screen easily with :

    g.setFontAlign(0, 0, 0);
    g.drawString(" " + analogRead(30).toFixed(8) + "%",120,120,true);

    So that will show you which number to use for the vhi variable, which is the upper limit. This needs to be done after you have fully charged the battery, meaning that you no longer see the green Power widget or Bangle.isCharging() returns false whilst plugged in. But you should try to do these tests under average load/strain conditions to get the best number for you. Im still testing the lower limits, but my method to set the lower limit so far has been to use the formula :

    origvlow + (newvhi-0.62)
    Which in my case is 0.51 + 1.3476562.

    The vlow used in original E.getBattery code is 0.51, and vhi is 0.62. If you're curious this is a 1:1 behaviour to the default api except with the volt constants changed.


Avatar for d3nd3-o0 @d3nd3-o0 started