I am using the following code in the simulator and cannot get the IRIN command to behave as expected. As I follow the logic' the IRIN command should wait for 5 sec (no IR input) then jump to the timeout section and turn on B.1 for 3 sec. But instead it immediately jumps to the IF lines. Is this just in the simulator? Trying to learn the limitation of the simulator.
#picaxe 08m2
; Receiver
main:
irin [5000,timeout],C.3,b0 ;wait for new signal
if b0 = 1 then swon1 ;switch on 2
if b0 = 4 then swoff1 ;switch off 2
goto main
swon1:
high B.2
goto main
swoff1:
low B.2
goto main
timeout:
high B.1
pause 3000
low B.1
goto main
#picaxe 08m2
; Receiver
main:
irin [5000,timeout],C.3,b0 ;wait for new signal
if b0 = 1 then swon1 ;switch on 2
if b0 = 4 then swoff1 ;switch off 2
goto main
swon1:
high B.2
goto main
swoff1:
low B.2
goto main
timeout:
high B.1
pause 3000
low B.1
goto main