I am trying to interface with an analog joystick. I have to code as :
main:
readadc 4,b1
if b1<200 then flsh
goto main
flsh:high 1
pause 1000
low 1
pause 1000
goto main
flsh2: high 1
pause 100
low 1
pause 100
goto main
That seems to be working good when I push the lever 1/2 way my led is flashing "flsh ". I have noticed at about <120 there could be another "cutoff" like make the led flash faster "flsh2" when the lever is all of the way up.My question is how do I get the code to read if it is <120 but not between< 120 and <200 . So when the lever reached the first point "<200" the led would flash slow as in "flsh", when I continued pushing the lever up to "<120" it would make my led flash more quicklyas in "flsh2". Thanks for your help.
main:
readadc 4,b1
if b1<200 then flsh
goto main
flsh:high 1
pause 1000
low 1
pause 1000
goto main
flsh2: high 1
pause 100
low 1
pause 100
goto main
That seems to be working good when I push the lever 1/2 way my led is flashing "flsh ". I have noticed at about <120 there could be another "cutoff" like make the led flash faster "flsh2" when the lever is all of the way up.My question is how do I get the code to read if it is <120 but not between< 120 and <200 . So when the lever reached the first point "<200" the led would flash slow as in "flsh", when I continued pushing the lever up to "<120" it would make my led flash more quicklyas in "flsh2". Thanks for your help.