hi,
I am trying to cause my code to switch back and forth between two subroutines.
I can get it to go to sub_2 by sending a "7" via the serial terminal, but when I send a "2", it does not switch back to sub_1.
I am trying to cause my code to switch back and forth between two subroutines.
I can get it to go to sub_2 by sending a "7" via the serial terminal, but when I send a "2", it does not switch back to sub_1.
Code:
'serrxd test
#picaxe 28X1
main:
if b0<3 then goto sub_1
if b0>6 then goto sub_2
sub_1:
pause 1000
serrxd [1000,ss], b0 'b0 receive serial value >6,
ss:
if b0>6 then goto sub_2
b1=100
sertxd (#b1,cr)
goto main
sub_2:
pause 1000
serrxd [1000,jj], b0 'b0 receive serial value <3,
jj:
if b0<3 then goto sub_1
b2=50
sertxd (#b2,cr)
goto main