OWIN
Syntax
OWIN *Pin, {Output1, Output2, ... Output6}, *[ InputList ]
InputList =
Variable | Array(expr) | String(expr) | Array \ count| String \ count{,InputList}
Description
OWIN begins with a RESET/Presence sequence on the designated Pin.
Then upto 6 Output bytes will be transfered to the device to select the command.
Following that the InputList will be read back from the device. The InputList consists of a list of variable names, string or array elements, or a string or array followed by a count. In the last case, a series of bytes will be read from the device and placed into individual elements of the string or array. The input list may consist of multiple parts with upto 32 different targets.
The bit order for the 1-Wire device is assumed to be LSB (bit 0) first. The REV function can be used to change the bit order.
Example
' write to the scratch pad of a DS2430
x = $be
y = $41
owout
7,present,[$cc,$f,$6,x,y]
print present
owin 7,$cc,$aa,$6,[a,b]
print
hex(a),hex(b)
Differences from other BASICs
- no equivalent in Visual BASIC
- simplified from PBASIC