BASIC stamp manual v2.2
Appendix C: Conversion Formatters
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 477
Conversion Formatters
This appendix lists the Conversion Formatters available for the commands
DEBUGIN, I2CIN, LCDIN, OWIN and SERIN and demonstrates, through
various input/output data examples, exactly what will be received when
using these formatters.
The following tables show data examples (characters received) across the
top and formatters across the left side, with the results of that combination
shown in the target cell.
For example, with the following code:
Value VAR WORD
DEBUGIN SDEC Value
the Decimal Formatters table shows us that if the characters -123 (followed
by a carriage return) are received, the SDEC formatter will translate that to
the word-sized decimal number -123 and will store that value into the
Value variable.
NOTE: In all tables below, values in target cells represent the number base
of the formatter (decimal for DEC, hexadecimal for HEX, etc) except where
noted. Additionally, “--“ means no valid data (or not enough valid data)
was received so the command will halt forever unless additional data is
received or SERIN’s Timeout argument is used.
Table C.1: Decimal Formatters.
Characters Received Decimal
Formatters
⊗
123
123⊗ -123⊗ ⊗123⊗ 12345⊗ 65536⊗ 255255⊗
DEC
-- -- 123 123 123 12345 0 58647
DEC1
-- 1 1 1 1 1 6 2
DEC2
-- 12 12 12 12 12 65 25
DEC3
-- 123 123 123 123 123 655 255
DEC4
-- -- 123 123 123 1234 6553 2552
DEC5
-- -- 123 123 123 12345 0 25525
SDEC
-- -- 123 -123 123 12345 0 -6889
SDEC1
-- 1 1 -1 1 1 6 2
SDEC2
-- 12 12 -12 12 12 65 25
SDEC3
-- 123 123 -123 123 123 655 255
SDEC4
-- -- 123 -123 123 1234 6553 2552
⊗ Means any non-decimal-numeric characters such as letters, spaces, minus signs, carriage
returns, control characters, etc. (Decimal numerics are: 0,1,2,3,4,5,6,7,8 and 9).