BASIC stamp manual v2.2

5: BASIC Stamp Command Reference – OWOUT
BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com Page 305
bitOne VAR Bit
bitTwo VAR Bit
bitOne = 0
bitTwo = 1
OWOUT 0, 5, [bitOne, bitTwo]
In the code above, we chose the value "5" for Mode. This sets Bit transfer
and Front-End Reset modes. Also, we could have chosen to make the
bitOne and bitTwo variables each a byte in size, but the BASIC Stamp
would still only use the their lowest bit (BIT0) as the value to transmit in
the OWOUT command (due to the Mode we chose).
The OWOUT command's OutputData argument is similar to the DEBUG
and SEROUT command's OutputData argument. This means data can be
sent as literal text, ASCII character values, repetitive 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
value = 65
OWOUT 0, 1, [value] ' send "A"
OWOUT 0, 1, [REP value\5] ' send "AAAAA"
OWOUT 0, 1, [DEC value] ' send "6" and "5"
OWOUT 0, 1, [HEX value] ' send "4" and "1"
OWOUT 0, 1, [BIN value] ' send "1000001"
Table 5.70 and Table 5.71 list all the special formatters and conversion
formatters available to the OWOUT command. See the DEBUG and
SEROUT commands for additional information and examples of their use.
Table 5.70: OWOUT Special
Formatters.
Special Formatter Action
?
Displays "symbol = x' + carriage return; where x is a number.
Default format is decimal, but may be combined with
conversion formatters (ex: BIN ? x to display "x =
binary_number").
ASC ?
Displays "symbol = 'x'" + carriage return; where x is an ASCII
character.
STR ByteArray {\L}
Send character string from an array. The optional \L argument
can be used to limit the output to L characters, otherwise,
characters will be sent up to the first byte equal to 0 or the end
of RAM space is reached.
REP Byte \L
Send a string consisting of Byte repeated L times
(ex: REP "X"\10 sends "XXXXXXXXXX").
SENDING AND FORMATTING DATA.