You are reading a single comment by @fanoush and its replies. Click here to read the full conversation.
  • to charge your Bangle up and then flatten it

    I never needed the lo - minimum. Since the voltage division is linear, for calibration it should be enough to just measure the highest value ever, claim that it is e.g. 4.2 and then everything else is computed from that. So e.g. if maximum in F07 fitness tracker is 0.18 then

    function battVolts(){
    return 4.20/0.18*analogRead(D5);
    }
    

    Then I do percentage based on volts e.g. like

    function battLevel(v){
      var l=3.5,h=4.19;
      v=v?v:battVolts();
      if(v>=h)return 100;
      if(v<=l)return 0;
      return 100*(v-l)/(h-l);
    }
    

    But it doesn't matter much. Important is that only one measured value (maximum ever) seems to be enough.

    it appears my high and low D3 readings are about 0.293 and 0.230 respectively, although I'm getting a sharp dropoff at about 0.255.

    so for you
    (4.20/0.293)*0.255 = 3.65V for the dropoff
    (4.20/0.293)*0.230 = 3.29V for the minimum

About

Avatar for fanoush @fanoush started