SERIN - BASIC Stamp Command Reference
Page 280
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
To further illustrate this, consider the following examples (assuming we’re
using the same code example as above):
1) Serial input: ABC
Result:
The BASIC Stamp halts at the SERIN command,
continuously waiting for decimal text.
2) Serial input: 123 (with no characters following it)
Result:
The BASIC Stamp halts at the SERIN command. It
recognizes the characters “1”, “2” and “3” as the number one
hundred twenty three, but since no characters follow the “3”, it
waits continuously, since there’s no way to tell whether 123 is the
entire number or not.
3) Serial input: 123 (followed by a space character)
Result:
Similar to example 2, above, except once the space
character is received, the BASIC Stamp knows the entire number
is 123, and stores this value in SerData. The SERIN command then
ends, allowing the next line of code, if any, to run.
4) Serial input: 123A
Result:
Same as example 3, above. The “A” character, just like the
space character, is the first non-decimal text after the number 123,
indicating to the BASIC Stamp that it has received the entire
number.
5) Serial input: ABCD123EFGH
Result:
Similar to examples 3 and 4 above. The characters
“ABCD” are ignored (since they’re not decimal text), the
characters “123” are evaluated to be the number 123 and the
following character, “E”, indicates to the BASIC Stamp that it has
received the entire number.
Of course, as with all numbers in the BASIC Stamp, the final result is
limited to 16 bits (up to the number 65535). If a number larger than this is
received by the decimal formatter, the end result will look strange because
the result rolled-over the maximum 16-bit value.
The BS1 is limited to the decimal formatter shown above, however the
BS2, BS2e, BS2sx and BS2p have many more conversion formatters
W
ATCH OUT FOR ROLLOVER ERRORS
.
Содержание BASIC Stamp 1
Страница 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...