Please help a newbie. I've spent days now trying to figure out how to read multiple switches using the setint command and am getting nowhere. I have a 40x and want to identify which of the eight inputs has been used and simply display a batch of leds in different sequences. I tried without the setint but with the number of pauses I want to use there is a noticable lag with the size of the program. I thought this kind of thing may work:
and it does in the simulator, but doesn't in real life. I need to the recognise the switches as they also send power to other devices and want to sync it all.
Any help would be a god send.
thanx
peet
Code:
let b0= 0
setint %00000001,%00000001
main:
pause 100
goto main
interrupt:
if b0 = 1 then sw_1
if b0 = 0 then sw_0
return
sw_0:
gosub chase0
b0= 1
goto main
sw_1:
gosub chase1
b0= 2
goto main
chase0:
high 0
pause 100
high 1
pause 100
let pins = %00000000
setint %00000011,%00000010
return
chase1:
high 1
pause 100
high 0
pause 100
let pins = %00000000
setint %00001111,%00000000
return
Any help would be a god send.
thanx
peet