Another Serin Question
Joms
Posts: 279
I am having another problem with the serin command.· I am trying to take a command in and store it to a veriable.· The devise that is hooked to the input of the basic stamp sends the command out automatically about every two seconds.· In the end I want to turn an LED on depending on if the command is the same as what is in memory.· I am working in small steps and right now I just want it to write the command to a variable and display it on the debug.· I have also included a few lines of code that will flash an LED and delay the program just to tell me that the thing is running...
I know that the SERIN command is supposed to wait until input detected but when I connect the input to the computer and monitor the serial port I see 7 HEX charactors come past.· Also, the settings I used on the computer to monitor the data are 4800 baud, 8 data bits, 1 stop bit, no parity.· Please let me know any ideas on where I am going wrong.· Thanks!...
'{$STAMP BS2}
'{$PBASIC 2.5}
serStr· VAR·· Byte(7)
DO
· SERIN 14, 16572, [noparse][[/noparse]STR serStr\7]
· DEBUG STR serStr
· HIGH 13
· PAUSE 250
· LOW 13
· PAUSE 250
LOOP
I know that the SERIN command is supposed to wait until input detected but when I connect the input to the computer and monitor the serial port I see 7 HEX charactors come past.· Also, the settings I used on the computer to monitor the data are 4800 baud, 8 data bits, 1 stop bit, no parity.· Please let me know any ideas on where I am going wrong.· Thanks!...
'{$STAMP BS2}
'{$PBASIC 2.5}
serStr· VAR·· Byte(7)
DO
· SERIN 14, 16572, [noparse][[/noparse]STR serStr\7]
· DEBUG STR serStr
· HIGH 13
· PAUSE 250
· LOW 13
· PAUSE 250
LOOP
Comments
Jeff T.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Stephen, I have read through the help file and dont think that the WAIT command will do what I want. I actually need it to trip a different relay depending on one of the four commands coming in. From my reading I think the WAIT command would only be helpful if I was attempting to switch one relay.
Also, I pretty much need to switch the relays off of the RS422 or RS232 because of the current cabling setup, otherwise I would just wire 4 buttons beside the controller and wire them directly to the relays or use a stamp for the latching part.
Do you have any other ideas on things to try. I have been playing with this off and on over the past few days using different commands and configurations....
THANK YOU FOR ALL YOUR HELP SO FAR!