SERIN - BASIC Stamp Command Reference
Page 282
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
The BS1’s SERIN command is limited to above-mentioned features. If you
are not using a BS1, please continue reading about the additional features
below.
The decimal formatter is only one of a whole family of conversion
formatters available with SERIN on the BS2, BS2e, BS2sx and BS2p. See
Table 5.76 for a list of available conversion formatters. All of the
conversion formatters work similar to the decimal formatter (as described
in the “Decimal Formatter Specifics” section, above). The formatters
receive bytes of data, waiting for the first byte that falls within the range of
characters they accept (e.g., “0” or “1” for binary, “0” to “9” for decimal,
“0” to “9” and “A” to “F” for hex, and “+” or “-” for signed variations of
any type). Once they receive a numeric character, they keep accepting
input until a non-numeric character arrives or (in the case of the fixed
length formatters) the maximum specified number of digits arrives.
While very effective at filtering and converting input text, the formatters
aren’t completely foolproof. As mentioned before, many conversion
formatters will keep accepting text until the first non-numeric text arrives,
even if the resulting value exceeds the size of the variable. After SERIN, a
byte variable will contain the lowest 8 bits of the value entered and a word
would contain the lowest 16 bits. You can control this to some degree by
using a formatter that specifies the number of digits, such as DEC2, which
would accept values only in the range of 0 to 99.
The BS2, BS2e, BS2sx and BS2p also have special formatters for handling a
string of characters, a sequence of characters and undesirable characters.
See Table 5.77 for a list of these special formatters. Also, see Appendix C
for example serial inputs and the result of using these formatters.
1
2
e
2
sx
2
p
2
A
DDITIONAL CONVERSION
FORMATTERS
.
O
NCE AGAIN
,
PAY ATTENTION TO
POTENTIAL ROLLOVER ERRORS
.
Содержание 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...