5: BASIC Stamp Command Reference – SEROUT
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 299
The SEROUT command sends quoted text exactly as it appears in the
OutputData list:
SEROUT 1, N2400, ( "HELLO", CR )
SEROUT 1, N2400, ( "Num = ", #100 )
--or--
SEROUT 1, 16780, [ "HELLO", CR ]
SEROUT 1, 16780, [ "Num = ", DEC 100 ]
The above code will display "HELLO" on one line and "Num = 100" on the
next line. Notice that you can combine data to output in one SEROUT
command, separated by commas. In the example above, we could have
written it as one line of code, with "HELLO", CR, "Num = ", DEC 100 in the
OutputData list.
The BS1’s SEROUT command is limited to above-mentioned features. If
you are not using a BS1, please continue reading about the additional
features below.
The SEROUT command can also be configured to pause between
transmitted bytes. This is the purpose of the optional Pace argument. For
example (9600 baud N8, inverted):
SEROUT 1, 16468, 1000, [ "Slowly" ]
Here, the BASIC Stamp transmits the word "Slowly" with a 1 second delay
between each character. See Table 5.79 for units of the Pace argument.
One good reason to use the Pace feature is to support devices that require
more than one stop bit. Normally, the BASIC Stamp sends data as fast as
it can (with a minimum of 1 stop bit between bytes). Since a stop bit is
really just a resting state in the line (no data transmitted), using the Pace
option will effectively add multiple stop bits. Since the requirement for 2
or more stop bits (on some devices) is really just a "minimum"
requirement, the receiving side should receive this data correctly.
Keep in mind that when we type something like “XYZ” into the SEROUT
command, the BASIC Stamp actually uses the ASCII codes for each of
those characters for its tasks. We could also typed: 88, 89, 90 in place of
“XYZ” and the program would run the same way since 88 is the ASCII
U
SING
SEROUT'
S
P
ACE ARGUMENT
TO INSERT DELAYS BETWEEN
TRANSMITTED BYTES
.
U
SING
ASCII
CODES
.
NOTE: The rest of the code
examples for this section are written
for the BS2, using the BS2's
BaudMode and Timeout values. Be
sure to adjust the value for your
BASIC Stamp.
1
1
2
e
2
sx
2
p
2
This is written with the BS2's
BaudMode value. Be sure to adjust
the value for your BASIC Stamp.
2
e
2
sx
2
p
2
Summary of Contents for BASIC Stamp 1
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...