5: BASIC Stamp Command Reference – OWOUT
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 207
FirstBit VAR BIT
SecondBit VAR BIT
FirstBit = 0
SecondBit = 1
OWOUT 0, 5, [FirstBit, SecondBit]
In the code above, we chose the value "6" for Mode. This sets Bit transfer
and Front-End Reset modes. Also, we could have chosen to make the
FirstBit and SecondBit 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 the ASCII value for "A"
OWOUT 0, 1, [REP Value\5] 'send the ASCII value for "A" five times, ie: "AAAAA"
OWOUT 0, 1, [DEC Value] 'send two characters, "6" and "5"
OWOUT 0, 1, [HEX Value] 'send two characters, "4" and "1"
OWOUT 0, 1, [BIN Value] 'send seven characters, "1000001"
Tables 5.50 and 5.51 list all the available special formatters and conversion
formatters available to the OWOUT command. See the DEBUG and
SEROUT commands for additional information and examples of their use.
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").
S
ENDING AND FORMATTING DATA
.
Table 5.50: OWOUT Special
Formatters.
Summary of Contents for BASIC Stamp 2e
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...