#picaxe 08m2
#no_data
#terminal 4800
symbol ADCvalue = W13
symbol ADCPin = C.1
do
do
W0 = ADCvalue ;remember last reading
readadc10 ADCpin,ADCvalue ;read voltage at pot wiper (gives an answer of 0-1023)
sertxd (cr,lf,"ADCvalue",#ADCvalue) ; debug
pause 100 ;may want to allow time for pot. to be moved
loop while ADCvalue <> W0 ;loop around until the value settles (ie pot stops moving)
sertxd(" - Pot. stable")
;
; Take action based on voltage read from pot.
;
select case ADCvalue
case 0 to 340
sertxd (" Pause 2secs") : pause 2000
case 341 to 680
sertxd (" Pause 4secs") : pause 4000
case 681 to 1023
sertxd (" Pause 6secs") : pause 6000
end select
loop