OWOUT
 
Syntax


#include <ONEWIRE.bas>                     ' source in /Program Files/Coridium/BASIClib

FUNCTION OWOUT (pin, OUTcnt, BYREF OUTlist as string)

Description

OWOUT begins with a RESET/Presence sequence on the designated Pin.

If a one-wire device responds the FUNCTION OWOUT will return 1, else 0.

Following that OUTcnt bytes from the OUTlist will be sent to the device. If OUTcnt is 0, then bytes will be sent from OUTlist until a 0 is found.  (the 0 is NOT sent).

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

#include <ONEWIRE.bas>

DIM outbytes(10) as string

                 ' write to the scratch pad of a DS2430
outbytes(0)=&Hcc
outbytes(1)=&Hf
outbytes(2)=&H6
outbytes(3)=&Hbe
outbytes(4)=&H41

present = owout (7 ,5, outbytes)
print present

Differences from other BASICs

See also