EasyManua.ls Logo

Parallax BASIC Stamp 2e - Page 302

Default Icon
353 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SEROUT - BASIC Stamp Command Reference
Page 300 BASIC Stamp Programming Manual 2.0b www.parallaxinc.com
code for the “X” character, 89 is the ASCII code for the “Y” character, and
so on.
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.85 for a list of available conversion formatters. All of the
conversion formatters work similar to the decimal formatter. The
formatters translate the value into separate bytes of data until the entire
number is translated or until the indicated number of digits (in the case of
the fixed length formatters) is translated.
The BS2, BS2e, BS2sx and BS2p also have special formatters for outputting
a string of characters, repeated characters and undesirable characters. See
Table 5.86 for a list of these special formatters.
Conversion
Formatter
Type of Number Notes
DEC{1..5} Decimal, optionally fixed to 1 5 digits 1
SDEC{1..5} Signed decimal, optionally fixed to 1 5 digits 1,2
HEX{1..4} Hexadecimal, optionally fixed to 1 4 digits 1
SHEX{1..4} Signed hexadecimal, optionally fixed to 1 4 digits 1,2
IHEX{1..4} Indicated hexadecimal, optionally fixed to 1 4 digits ($ prefix) 1
ISHEX{1..4}
Signed, indicated hexadecimal, optionally fixed to 1 4 digits
($ prefix)
1,2
BIN{1..16} Binary, optionally fixed to 1 16 digits 1
SBIN{1..16} Signed binary, optionally fixed to 1 16 digits 1,2
IBIN{1..16} Indicated binary, optionally fixed to 1 16 digits (% prefix) 1
ISBIN{1..16} Signed, indicated binary, optionally fixed to 1 16 digits (% prefix) 1,2
1 Fixed-digit formatters like DEC4 will pad the number with leading 0s if necessary; ex:
DEC4 65 sends 0065. If a number is larger than the specified number of digits, the
leading digits will be dropped; ex: DEC4 56422 sends 6422.
2 Signed modifiers work under two's complement rules.
ADDITIONAL CONVERSION
FORMATTERS
.
Table 5.85: BS2, BS2e, BS2sx and
BS2p Conversion Formatters.

Table of Contents

Related product manuals