Parallax BASIC Stamp 2e Programming Manual page 209

Table of Contents

Advertisement

S
ENDING AND FORMATTING DATA
Table 5.50: OWOUT Special
Formatters.
5: BASIC Stamp Command Reference – OWOUT
FirstBit
VAR
SecondBit VAR
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
Value = 65
OWOUT 0, 1, [Value]
OWOUT 0, 1, [REP Value\5] 'send the ASCII value for "A" five times, ie: "AAAAA"
OWOUT 0, 1, [DEC Value]
OWOUT 0, 1, [HEX Value]
OWOUT 0, 1, [BIN Value]
Tables 5.50 and 5.51 list all the available special formatters and conversion
formatters available to the OWOUT command.
SEROUT commands for additional information and examples of their use.
Special Formatter
?
ASC ?
STR ByteArray {\L}
REP Byte \L
BIT
BIT
BYTE
'send the ASCII value for "A"
'send two characters, "6" and "5"
'send two characters, "4" and "1"
'send seven characters, "1000001"
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").
Displays "symbol = 'x'" + carriage return; where x is an ASCII
character.
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.
Send a string consisting of Byte repeated L times
(ex: REP "X"\10 sends "XXXXXXXXXX").
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 207
See the DEBUG and
Action

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents