BASIC stamp manual v2.2

5: BASIC Stamp Command Reference – SERIN
BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com Page 393
SERIN
BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
SERIN Rpin, Baudmode, { ( Qualifier ), } { # } InputData
SERIN Rpin { \Fpin }, Baudmode, { Plabel, } { Timeout, Tlabel, } [ InputData ]
Function
Receive asynchronous serial data (e.g., RS-232 data).
Rpin is a variable/constant/expression (0 – 16) that specifies the I/O
pin through which the serial data will be received. This pin will be
set to input mode. On all BS2 models, if Rpin is set to 16, the BASIC
Stamp uses the dedicated serial-input pin (SIN, physical pin 2),
which is normally used by the Stamp Editor during the download
process.
Fpin is an optional variable/constant/expression (0 – 15) that
specifies the I/O pin to indicate flow control status on. This pin will
be set to output mode.
Baudmode is variable/constant/expression (0 – 7 on the BS1, 0
65535 on all BS2 models) that specifies serial timing and
configuration.
Qualifier is an optional variable/constant (0 – 255) indicating data
that must be received before execution can continue. Multiple
qualifiers can be indicated with commas separating them.
Plabel is an optional label indicating where the program should go
in the event of a parity error. This argument should only be
provided if Baudmode indicates 7 bits, and even parity.
Timeout is an optional variable/constant/expression (0 – 65535) that
tells SERIN how long to wait for incoming data. If data does not
arrive in time, the program will jump to the address specified by
Tlabel.
Tlabel is an optional label that must be provided along with Timeout,
indicating where the program should go in the event that data does
not arrive within the period specified by Timeout.
InputData is list of variables and formatters that tells SERIN what to
do with incoming data. SERIN can store data in a variable or array,
interpret numeric text (decimal, binary, or hex) and store the
NOTE: Expressions are not allowed as
arguments on the BS1. The range of
the Rpin argument on the BS1 is 0 – 7.
NOTE: The BS1's InputData argument
can only be a list of variables and the
optional decimal modifier (#).
1
All
2
1
1