Hi! I have a 10K pot used as voltage divider into AN2 and I want to use it to adjust the result value between 0-127. I can get the 10bit result, but how can I convert the 10bit result to 7bit so that I can use the whole range of pot?
Also how can I calibrate the A/D output to be always 0-127? I measured my pot and the max value it gives to AN2 is 4.97Volts, so i miss some bits. I'd like to have a calibration routine that can measure max and min values of the pot and then always adjust the output to be 0-127, no matter what pot is used. Is this possible?
Also how can I calibrate the A/D output to be always 0-127? I measured my pot and the max value it gives to AN2 is 4.97Volts, so i miss some bits. I'd like to have a calibration routine that can measure max and min values of the pot and then always adjust the output to be 0-127, no matter what pot is used. Is this possible?