USBmicro

Your source for USB electrical device interface products.

  • Home
  • Services
    • Design
    • Contact USBmicro
  • Where to buy…
You are here: Home / Documentation / Device Commands / Write1Wire

Write1Wire

Write a byte to 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 write on the previously selected port pin.

Command Syntax: (USBm.dll)

USBm_Write1Wire( device, data )

The USBm_Write1Wire function syntax has these parts:

Part Description
device A zero-based index to address the appropriate USB device.
data Byte to write to the bus.

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_Write1Wire _
    Lib “USBm.dll” _
        (ByVal device As Byte, _
               ByVal data As Byte)_
  As Integer

VB Example

USBm_Write1Wire 3, 9

This code fragment addresses U4x1 device #3 and writes the value of 9 on the 1-wire bus (line to use previously selected by the Reset1Wire command).


C Prototype

int USBm_Write1Wire ( unsigned char device, unsigned char data );

C Example

USBm_Write1Wire ( 3, 9 );

This code fragment addresses U4x1 device #3 and writes the value of 9 on the 1-wire bus (line to use previously selected by the Reset1Wire command).


RobotBASIC

usbm_Write1Wire(ne_DeviceNumber,ne_Data)

Returns true if successful, false otherwise. Writes a byte to the 1wire device.


Raw Command

See Write1WireBit

Documentation

Open all | Close all