Shop OBEX P1 Docs P2 Docs Learn Events
SERIN/SEROUT question — Parallax Forums

SERIN/SEROUT question

Statix_nsccStatix_nscc Posts: 4
edited 2010-12-06 14:17 in BASIC Stamp
Hello,

I have a question for the forum,

Is it possible to have a SERIN become an input?
For example, if I had;
DO
IF (IN3 = 0) THEN
SEROUT 4, 84, ["A"]
ELSEIF (IN4 = 0) THEN
SEROUT 4, 84, ["B"]
ENDIF
LOOP

Is there a way to have

IF (SERIN = "A") THEN
HIGH 14
ELSEIF (SERIN = "B") THEN
HIGH 13

and so on... for a maximum of 9 inputs.

I'm new to the BS2 and trying to incorporate wireless into a project I am working on, the above code is just an example using two BS2 hooked up via a cable.

Basically what I am trying to achieve is for one stamp to monitor something and then activate code on the second stamp so that it will display status on a LCD screen attached to the second BS2

I've been all over the internet looking for tidbits of information with no luck.

Thanks for your time.

Cheers,

Statix

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-12-06 09:47
    No. SERIN is a statement. Typically you use SERIN to store the received byte into a variable, then you use that variable for whatever decision making you want. Read the description of SERIN in either the Stamp Manual (Basic Stamp Syntax and Reference Manual) or the Stamp Editor's help files.
  • NewGuy2NewGuy2 Posts: 4
    edited 2010-12-06 14:17
    Yes, you CAN use "SERIN" to recieve a signal from another BS2. However, the syntax of your example is completely wrong, so you will have to lookup "SERIN" in the 'Help' section.
Sign In or Register to comment.