| Online Development Notebook > Index > Programming Overview > Device Commands > Read1Wire |
Read1Wire - Read a byte from a 1-wire bus⁄device
VERSION 1.30+ of the firmware, VERSION 36+ of the DLL
Description:
This is a function to send a 1-wire (MicroLAN) byte read on the previously selected port pin.
Command Syntax: (USBm.dll)
USBm_Reset1Wire( device, dataarray )
The USBm_Reset1Wire function syntax has these parts:
| Part | Description |
| device | A zero-based index to address the appropriate USB device. |
| dataarray | The function causes this variable to be changed to the value read from the bus. Minimum array size of 8. |
Remarks:
This command does not set the port direction pins or select the pin to use as the 1-wire bus - it is the Reset1Wire command that does this.
VB Declaration
| Public Declare Function USBm_Read1Wire _ Lib "USBm.dll" _ (ByVal device As Byte, _ ByRef dataarray As Byte)_ As Integer |
VB Example
| Dim dataarray(8) As Byte USBm_Read1Wire 3, dataarray(0) |
This code fragment addresses U4x1 device #3, and reads a byte from the 1-wire device. The read value is in "dataarray(0)".
C Prototype
| int USBm_Read1Wire ( unsigned char device, unsigned char * data ); |
C Example
| USBm_Read1Wire ( 3, dataarray ); |
This code fragment addresses U4x1 device #3, and reads a byte from the 1-wire device. The read value is in "data".
RobotBASIC
usbm_Read1Wire(ne_DeviceNumber)
Returns a byte value that is read from the 1wire device.
Raw Command
See Read1WireBit
Hardware: U401 USB Interface U421 USB Interface U451 USB Interface
Programming: USBm DLL Programming Download Files
Application Notes: U4x1 Application Notes Misc Applications and Information FAQ
While every effort has been made to make sure that the information posted on this site is correct, the author can not be held liable for any damages whatsoever for losses as a result of the application of this information. Use this information at your own risk.
USBmicro can design your custom and semi-custom USB product. Email about USB design can be directed to " Robert " at usbmicro.com.
Copyright © USBmicro, L.L.C., 2002-2010