Icon of block

IIC Read Block

This block reads from Register ? of an IIC (Inter-Integrated Circuit) sensor connected to port ? at Address ?. Enter Address and Register values in decimal form. (example 64 = Hx40, 111 = Hx6F). Output is in decimal.

You must drag at least one output data wire from this block’s data hub to another block for any information to be sent.

Display Settings

IIC Read Block Icon
  1. The number (top right) shows which of your NXT’s ports this block reads from. You can change this number in the configuration panel.
  2. The number (middle left with the 'A') shows the address this block reads from. You can change this number in the configuration panel at the 'Address' field.
  3. The number (middle left with the 'R') shows the Register this block reads from. You can change this number in the configuration panel at the 'Reg' field. Some IIC sensors have only one register. In this case you need to turn off writing the Reg value so Value is readed from the only register. Uncheck the WriteReg field to turn off Reg. The number (middle left with the 'R') will appear grayed out. (enter all values as decimal. example 64 = Hx40, 111 = Hx6F)

Configuring the IIC Read block

IIC Read Config

IIC Read block Data Hub plugs

IIC Read block

This chart shows the different characteristics of the plugs on the IIC Read 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 Reg Number 0 - 255 The register of the device to read from Ignored if 'WriteReg' = True
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.
 
Number Out Raw Value Number 0 - 255 value returned from the IIC device If error, this plug is set to port number