I decided to obtain some kind of ADC calibration, so I took out a semi-accurate thermometer, attached it to my Touch Pro battery, and made some sort of device to put my Touch Pro above the range while I took measurements. I obtained the curve on the right, which as you can see, is very linear (R² = 0.9961) . It should be about right, translating the low cutoff to about 45 °C and the high cutoff to about 0 °C. I also wanted to make sure the curve was linear for the entire range, but putting my Touch Pro in the freezer took too long to cool it in these summer temperatures, I only got it down to 30 °C. For those of you who don’t want to read graphs, to convert the ADC value to a temperature in degrees Celsius, use the formula:
Temp °C = –0.0386 x ADC Value + 149.94
And to convert it back, if you’re bad at algebra:
ADC Value = (Temp °C – 149.94) / –0.0386
I’ll update nuePower to use this new formula, as well as the nueBattery2 settings app.