You are reading a single comment by @andrewg_oz and its replies. Click here to read the full conversation.
  • I've decided to go with:

    E.getBattery = function() {
      const lo=0.255,hi=0.293;
      var b=Math.max(lo,Math.min(hi,analogRead(D3)­));
      return Math.round((b-lo)*100/(hi-lo));
    };
    

    and saved it as "getbattery.boot.js". Adjust "hi" and "lo" as required.

About

Avatar for andrewg_oz @andrewg_oz started