Hi everyone, I got the code to work but on 10K pot... Thanks for the inputs everyone.
I used the same connections and the codes from forum's input.
Code:
DEFINE OSC 20
' Define ADCIN parameters
DEFINE ADC_BITS 8
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50
adval Var Byte ' Create adval to store result(slider)
TRISA = %11111111
ADCON1 = %00000100
mainloop:
ADCIN 0, adval ' Read channel 0 to adval
Serout2 PORTD.2, 84, [$1B,$45] ' Clear
Serout2 PORTD.2, 84, [" Slider: ",#adval]'
Pause 150 ' Wait .15 second
Goto mainloop ' Do it forever
End

regards,
tacbanon
Bookmarks