Hi,
I think that your maxvalue and minvalue should be the raw value from the adc ie. between 0 and 1023 and not the raw value times 64.
Otherwise this will not work:
You get a value between 0 and 1023 from the ADC. Then you subtract 2200 from that which will make it negative and you don't want that.Code:dummy = (AdcResult - MinValue) * 64
Try setting the max and min value to the raw reading from the ADC.
/Henrik Olsson
Bookmarks