Start Back Next End
  
ZBasic System Library
133
ZBasic Microcontrollers
Get1WireData
Type
Subroutine
Invocation
Get1WireData(pin, data, count)
Parameter
Method
Type
Description
pin
ByVal
Byte
The pin to be used for 1-Wire I/O.
data
ByRef
any type
The variable to receive the bytes read.
count
ByVal
Byte
The number of bytes to read.
Discussion
This function retrieves 1 or more bytes (each LSB first) using the 1-Wire protocol and writes them to the
given variable.  To perform a 1-Wire operation, this function along with related 1-Wire routines must be
used in the proper sequence.  See the specifications of your 1-Wire device for more information.
Caution
If the variable provided has fewer bytes than the given count, subsequent memory locations will be
altered, usually with undesirable consequences.
Resource Usage
This routine uses the I/O Timer and disables interrupts for about 100µS for each bit received.
Example
Dim ba(1 to 10) as Byte
Call Get1WireData(12, ba, SizeOf(ba))
See Also
Previous page Top Next page