Something like this,
Code:lp: AVERAGE = 0 FOR I = 0 TO 9 ADCON0.1=%1 WHILE ADCON0.1=%1:WEND ' Store ADC results isense.HIGHBYTE=ADRESH isense.LOWBYTE=ADRESL AVERAGE = AVERAGE + isense NEXT I AVERAGE = AVERAGE / 10 ISENSE = AVERAGE ' Security fault verifications IF isense**40000>imax THEN flt=1 ' LCD idisp=isense**40000 lcdout $fe,$c0,$1,$20,"1 ISENS: ",DEC idisp DIG 2,DEC idisp DIG 1,".",DEC idisp DIG 0,"A" goto lp





Bookmarks