BASIC stamp manual v2.2
5: BASIC Stamp Command Reference – OWIN
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 297
bitOne VAR Byte
bitTwo VAR Byte
OWIN 0, 6, [bitOne, bitTwo]
In the code above, we chose the value “6” for Mode. This sets Bit transfer
and Back-End Reset modes. Also, we could have chosen to make the
bitOne and bitTwo variables each a byte in size, but they still would only
have received one bit each in the OWIN command (due to the Mode we
chose).
The OWIN command’s InputData argument is similar to the SERIN
command’s InputData argument. This means data can be received as
ASCII character values, decimal, hexadecimal and binary translations and
string data as in the examples below. (Assume a 1-Wire device is used and
that it transmits the string, “Value: 3A:101” every time it receives a Front-
End Reset pulse).
value VAR Byte(13)
OWIN 0, 1, [value] ‘ receive ASCII value for “V”
OWIN 0, 1, [DEC value] ‘ receive the number 3
OWIN 0, 1, [HEX value] ‘ receive the number $3A
OWIN 0, 1, [BIN value] ‘ receive the number %101
OWIN 0, 1, [STR value\13] ‘ receive “Value: 3A:101”
Table 5.65 and Table 5.66 list all the special formatters and conversion
formatters available to the OWIN command. See the SERIN command for
additional information and examples of their use.
Table 5.65: OWIN Special
Formatters.
Special Formatter Action
SPSTR L
Input a character string of length L bytes (up to 126) into
Scratch Pad RAM, starting at location 0. Use GET to retrieve
the characters.
STR ByteArray \L {\E}
Input a character string of length L into an array. If specified,
an end character E causes the string input to end before
reaching length L. Remaining bytes are filled with 0s (zeros).
WAITSTR ByteArray {\L}
Wait for a sequence of bytes matching a string stored in an
array variable, optionally limited to L characters. If the
optional L argument is left off, the end of the array-string must
be marked by a byte containing a zero (0).
SKIP Length Ignore Length bytes of characters.
RECEIVING FORMATTED DATA.