SEROUT command replaces a variable
T3rr0rByte13
Posts: 29
I am having an issue where the serout command replaces a variable i am using to store the value of IR detection. I am using a boebot with the easy bluetooth module.
the below is just a snippet of code from the program, all variables are declared.
The problem is when the debug command shows up I see: 11 and 10 when both IR's are triggered.
However commenting out the serout commands, the debug command shows: 00 when both IR's are triggered
What am I missing??
the below is just a snippet of code from the program, all variables are declared.
do freqout 2, 1, 38500 irDetectLeft = IN0 freqout 8, 1, 38500 irDetectRight = IN9 serout TX, baud, ["3"] serout TX, baud, ["2"] serout TX, baud, ["1"] serout TX, baud, ["0"] debug home, BIN1 irdetectleft, BIN1 irdetectright loop
The problem is when the debug command shows up I see: 11 and 10 when both IR's are triggered.
However commenting out the serout commands, the debug command shows: 00 when both IR's are triggered
What am I missing??
Comments
walkin79,
Use the Edit Post button at the bottom of your messages. You'll see a Delete button in the row of buttons at the bottom of the edit window.
The SEROUT sets pin #0 to output mode so the IN0 will return the state of the output register (OUTS) bit rather than the input status of the I/O pin. Putting an INPUT 0 statement after the DO will reset I/O pin #0 to input mode, but you really have to use a different I/O pin for RX and TX.