LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem setting up the I2C communication

Hello all. I am currently working on a project where I am using labVIEW to control the peripheral through an Arduino (mega 2560), so I can monitor and control my system in real time. I am curently trying to establish an I2C communication with a digital infrared sensor (ZX distance and gesture sensor by sparkfun). I am currently trying to read I2C data from a the z coordinate register on the sensor. The address of the register is 0x0a (10 in decimal), and the address of the sensor itself is 0x10 (16 in decimal). It is also worth noting that the data stored in the register I am trying to read from is in 8 bits (0 to 7).

 

Now, I believe that I2C data is transferred in 3 packets of 8 bits containing the device address, register address and data within register respectively.

 

The confusion I am having concerns how this works with the I2C functions built in the LIFA. I have had a go at wiring the system and testing with the VI attached in the picture but it doesn't seem to read anything.

 

Please let me know where I went wrong (in this VI or elsewhere) and help me understand how to I2C VI's work. I believe it all lies in the I/O if the I2C vi's

 

Thanks in advance

0 Kudos
Message 1 of 3
(3,501 Views)
0 Kudos
Message 2 of 3
(3,500 Views)

First, I'd recommend that you use LINX since it replaced LIFA a few years ago (and is much easier to use and customize).  Then, I'd recommend taking a look at some of the sensor VI's provided with LINX (e.g. the ADXL345 or the MPU60X0 VI's which use I2C to talk to an accelerometer).

0 Kudos
Message 3 of 3
(3,358 Views)