hello i was wondering if anyone could point me in the right direction.
im using setint and a interrupt to change modes when the button is released. however i want to use readadc to change through modes nicly. i also want to use the readadc within my interupt.
here is the snippet of the code i have now:
when i debuged the readadc on the button i want to use the values i recieved where 255 when not pressed and when the button was pressed i brought the value down to 0.
heres what i have attempted to combine the readadc.
however the code that i have attempted is incorrect can sombody point me on the correct lines?
thanks
im using setint and a interrupt to change modes when the button is released. however i want to use readadc to change through modes nicly. i also want to use the readadc within my interupt.
here is the snippet of the code i have now:
Code:
interrupt:
do loop while pin2 = 1 'wait for button release
mode = mode + 1 & %00000111
setint %00000100,%00000100 'pin2 high
return
do
loop
heres what i have attempted to combine the readadc.
Code:
interrupt:
readadc 2, b0
if b0 < 200 then
do loop while b0 < 200
endif
mode = mode + 1 & %00000111
setint %00000100,%00000100
return
do
loop
thanks