the first thing i notice is you have not set a sample time , not sure if or what the defa may be
try this
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS
secondly the adcin command has often been accused of wonky readings when the channel is changed
try this known work around of dual reads after a ch change
Code:
Mainloop:
rem ADC 0
adcin 0, ADCinput
adcin 0, ADCinput
NewADC0 = 1023 - ADCinput ' inverted so pot goes from 0 to 1024
if NewADC0 <> oldadc0 then
oldadc0 = NewADC0
LCDOUT $FE, $94+6, DEC4 oldadc0 : Pauseus 1
endif
rem ADC 3
adcin 3, ADCinput
adcin 3, ADCinput
NewADC3 = ADCinput
if NewADC3 <> oldadc3 then
oldadc3 = NewADC3
LCDOUT $FE, $D4+6, DEC4 oldadc3 : Pauseus 1
endif
GOTO Mainloop
end
Bookmarks