READADC10will give a result between 0 and 1023, depending on this voltage.
#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
I didn't remember, I looked at Dave's previous posts !That is a very odd thing to remember