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.
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...