Yup they all have the same register.
ADCIN select the channel, perform the conversion, then read it from ADRESH/ADRESL register, then dump it to your variable.
Type: Posts; User: mister_e; Keyword(s):
Yup they all have the same register.
ADCIN select the channel, perform the conversion, then read it from ADRESH/ADRESL register, then dump it to your variable.
OK, so you have the results left justified, it should work. BUT maybe you have some nifty noise on the line or something like that. Allow a certain error margin.
test 0
If pw<5 then
...
For debugging purpose I always suggest people use a LCD, ICD or use PC Terminal to see what's happen INSIDE the PIC.
Also, post your PIC model, whole code so we see your ADC DEFINES. Is the ADC...
Bingo! 0-255 it is.