#include
<ONEWIRE.bas>
' source in /Program Files/Coridium/BASIClib
SUB OWIN (pin, OUTcnt, BYREF OUTlist as string, INcnt, BYREF INlist as string)
OWIN begins with a RESET/Presence sequence on the designated
Pin.
Then OUTcnt bytes will be transferred to the device to select the command. OUTcnt may be 0, with an empty string "".
Following that the INcnt bytes InputList will be read back from the device. If INcnt equals 0, then the string will be filled with bytes until a 0, CR or LF character is received. Note that no bounds checking is performed on the input, and if a 0, CR, or LF is never received then this routine will hang. As there is no bounds checking its possible to overwrite other variables, if less than 256 bytes have been allocated for the InputList string..
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.