code: public float getVoltage() {
          // Range mapping from http://stackoverflow.com/a/7506169/254187
          float inMin = 0;
          float inMax = 100;
          float outMin = (float) 2.0;
          float outMax = (float) 3.7;
          float x = this.percentage;
  
          return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
      }
docs: Get the battery level in volts.
  @return Voltage of battery, 2.0 to 3.7 volts inclusive