Parallax BASIC Stamp 2e Programming Manual page 302

Table of Contents

Advertisement

SEROUT - BASIC Stamp Command Reference
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.
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
DEC{1..5}
Decimal, optionally fixed to 1 – 5 digits
SDEC{1..5}
Signed decimal, optionally fixed to 1 – 5 digits
HEX{1..4}
Hexadecimal, optionally fixed to 1 – 4 digits
SHEX{1..4}
Signed hexadecimal, optionally fixed to 1 – 4 digits
IHEX{1..4}
Indicated hexadecimal, optionally fixed to 1 – 4 digits ($ prefix)
Signed, indicated hexadecimal, optionally fixed to 1 – 4 digits
ISHEX{1..4}
($ prefix)
BIN{1..16}
Binary, optionally fixed to 1 – 16 digits
SBIN{1..16}
Signed binary, optionally fixed to 1 – 16 digits
IBIN{1..16}
Indicated binary, optionally fixed to 1 – 16 digits (% prefix)
ISBIN{1..16}
Signed, indicated binary, optionally fixed to 1 – 16 digits (% prefix)
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.
Page 300 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
Type of Number
A
DDITIONAL CONVERSION
.
FORMATTERS
The
Table 5.85: BS2, BS2e, BS2sx and
Notes
BS2p Conversion Formatters.
1
1,2
1
1,2
1
1,2
1
1,2
1
1,2

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents