i have add this in my code:
Code:
CMCON = 7 ' PortA = digital I/O
ANSEL = %00010000 ' Will set RA4 as analog and all others as digital
ADCON0 = %11100001
ADCON1 = %10000010
adval var Byte 'Create adval to store result
IN var PORTA.4
Input IN
loop: ADCIN 0, adval ' Read channel 0 to adval
Lcdout $fe, 1 ' Clear LCD
Lcdout "Value: ", DEC adval ' Display the decimal value
Pause 100 ' Wait .1 second
Goto loop ' Do it forever
End
need to add this;
Code:
Define ADC_BITS 8 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uS
but show on LCD Value:3 continues
Bookmarks