BASIC Stamp 2 interaction
ilya
Posts: 13
I am trying to have one BASIC Stamp communicate with another. I need one Stamp to send out a variable named "ActualAngleDegr" which is an 8 bit variable. I need the other stamp to read this variable and use it in a set of logical commands. I have been trying to use the SERIN and SEROUT commands but the variable has not been transmitting. The code for the Stamp that sends the variable is (I only included the actual line that should send the variable):
SEROUT 5, 396, [noparse][[/noparse]DEC3 ActualAngleDegr]
The code for the Stamp that receives the variable is (I only included the lines that input the variable and display it):
ActualAngleDegr VAR Word
SERIN 0, 396, [noparse][[/noparse]ActualAngleDegr]
DEBUG MoveTo, 0, 3, "ActualAngleDegr is: ", ActualAngleDegr, " "
When the two Stamps are run the debug screen opens but no text appears. Any thoughts or suggestions? Thanks.
-Ilya
SEROUT 5, 396, [noparse][[/noparse]DEC3 ActualAngleDegr]
The code for the Stamp that receives the variable is (I only included the lines that input the variable and display it):
ActualAngleDegr VAR Word
SERIN 0, 396, [noparse][[/noparse]ActualAngleDegr]
DEBUG MoveTo, 0, 3, "ActualAngleDegr is: ", ActualAngleDegr, " "
When the two Stamps are run the debug screen opens but no text appears. Any thoughts or suggestions? Thanks.
-Ilya
Comments
SEROUT 5,396,[noparse][[/noparse]"!", DEC ActualAngleDegr, ";"]
SERIN 0,396,[noparse][[/noparse]wait("!"), DEC ActualAngleDegr]
The receiving Stamp will see the non-digit character after the number and use that to mark the end of the numeric value.
' {$STAMP BS2}
' {$PBASIC 2.5}
ActualAngleDegr VAR Word
MoveTo CON 2
SERIN 0,396,[noparse][[/noparse]WAIT("!"), DEC ActualAngleDegr]
DEBUG MoveTo, 0, 3, "ActualAngleDegr is: ", ActualAngleDegr, " "
Yet it does not write anything when the debug screen opens. I know the first stamp writes a number to the variable ActualAngleDegr. Could the problem be that the first Stamp is not transmitting the variable correctly or at all? Thanks.