Another question on SEROUT/SERIN
holely
Posts: 9
Hi all,
I am doing a race management system project, and it requires the system to be able to detect the rankings of each car. Hence I came up with the following simple test programs.
For the host BS2sx, the program is as follows:
=======================
' {$STAMP BS2sx}
com VAR Byte
check:
SERIN 1, 17405, [noparse][[/noparse]com]
IF com=230 THEN l1
IF com=231 THEN l2
GOTO check
l1:
DEBUG "1"
GOTO check
l2:
DEBUG "2"
GOTO check
For lane 1:
=======================
' {$STAMP BS2}
lapin VAR IN7
WAIT1:
IF lapin=1 THEN out
GOTO WAIT1
out:
SEROUT 1, 16780, [noparse][[/noparse]230]
GOTO wait1
For lane 2:
=======================
' {$STAMP BS2}
lapin VAR IN6
WAIT1:
IF lapin=1 THEN out
GOTO WAIT1
out:
SEROUT 1, 16780, [noparse][[/noparse]231]
GOTO wait1
The problem is after the first car(for e.g., lane 1 passes first), "1" is being debugged. Even though lane 2 passes subsequently, "2" is not being debugged.
What could be the problem?
Thanks in advance for any reply.
I am doing a race management system project, and it requires the system to be able to detect the rankings of each car. Hence I came up with the following simple test programs.
For the host BS2sx, the program is as follows:
=======================
' {$STAMP BS2sx}
com VAR Byte
check:
SERIN 1, 17405, [noparse][[/noparse]com]
IF com=230 THEN l1
IF com=231 THEN l2
GOTO check
l1:
DEBUG "1"
GOTO check
l2:
DEBUG "2"
GOTO check
For lane 1:
=======================
' {$STAMP BS2}
lapin VAR IN7
WAIT1:
IF lapin=1 THEN out
GOTO WAIT1
out:
SEROUT 1, 16780, [noparse][[/noparse]230]
GOTO wait1
For lane 2:
=======================
' {$STAMP BS2}
lapin VAR IN6
WAIT1:
IF lapin=1 THEN out
GOTO WAIT1
out:
SEROUT 1, 16780, [noparse][[/noparse]231]
GOTO wait1
The problem is after the first car(for e.g., lane 1 passes first), "1" is being debugged. Even though lane 2 passes subsequently, "2" is not being debugged.
What could be the problem?
Thanks in advance for any reply.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA