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
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...