I suggest you try this modification. I think it will work.
Regards
Jerson
Code:IF ADCON0.1 = 0 THEN Nvalue = ADRESH*256 + ADRESL ' read ADC result ELSE GOTO Wait10 ENDIF ADCON0.1 = 1 ' relaunch conversion Ivalue = (Ivalue*9 + Nvalue )/10 ' Rolling average GOSUB Convert IF Dvalue < Mvalue THEN Mvalue = Dvalue ' Memorize Minimum Wait10: ' Prepare value to be displayed
Bookmarks