Icon of block

IIC Write Block

This block Writes to the Register ? of an IIC (Inter-Integrated Circuit) sensor connected to port ? at Address ?.

Display Settings

IIC Write Block Icon
  1. The number (upper right corner) shows which of your NXT’s ports this block writes to. You can change this number in the configuration panel if you need to.
  2. The number (middle left top with the 'A') shows the address this block writes to. You can change this number in the configuration panel at the 'Address' field.
  3. The number (middle left middle with the 'R') shows the Register this block writes to. You can change this number in the configuration panel at the 'WReg' field. Some IIC sensors have only one register. In this case you need to turn off writing the WReg value so WValue will be writen to the only register. Uncheck the WriteReg field to turn off WReg. The number (middle left middle with the 'R') will appear grayed out.
  4. The number (left bottom with the 'V') shows the value this block writes. You can change this number in the configuration panel at the 'WValue' field. (enter all values as decimal. example 64 = Hx40, 111 = Hx6F).

Configuring the IIC Read block

IIC Write Config

IIC Write block Data Hub plugs

IIC Write Block

This chart shows the different characteristics of the plugs on the IIC Write block’s data hub:

  Plug Data Type Possible Range What the Values Mean This Plug is Ignored When...
Port Port Number 1 - 4 Selects the port the IIC device is connected to  
Number 1 Address Number 2 - 254 The address of the device to read from (even numbers only)  
Number 2 WReg Number 0 - 255 The register of the device to write to Ignored if 'WriteReg' = True
Number 2 WValue Number 0 - 255 The value to write  
Yes / No WriteReg Logic True/False True = write register value, False = do not write register value  
Yes / No Yes / No Logic True/False True = an error on the bus occurred, False = no error  
Number Out Status Out Number 32 - -35 0 = no error.
32 = Port is busy performing a transaction.
-35 = Last transaction failed (possible device failure).
-33 = Specified port is out of range.
-32 = Specified port is not properly configured.