Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Get IMU sensor values on LabView/LINX

I've downloaded LINX for programming Arduino with Labview.

 

I've connected MPU9250 (I2C interface) to Arduino Uno (SCLK to A5 & SDA to A4 pin), and made a simple program on Labview to get the gyroscope values (X, Y and Z values)

 

I'm totally new to Labview and I can't find proper tutorials on YT for I2C/Arduino/Labview/LINX, so I've made this program on whatever similar tutorials I could find on YT.

 

I've attached the program file. Can anyone check it and tell if I've made it right?

0 Kudos
Message 1 of 2
(976 Views)

Hey sarwatsarfaraz

Probably you haven't tested. but if you did, you probably did not get any value right?

First of all, you need to understand how I2c works, and i am no expert, but can point you some directions.

https://www.youtube.com/watch?v=7CgNF78pYQM 

https://www.youtube.com/watch?v=mQzpGnkSaYk (this one is in portuguese, but you can follow the programming flow 

second, you really need to read the MPU-9250 datasheet to understand the reading and writing algorithm, with registers you want to get and set.

perhaps datasheet is to difficult to understand. then i recommend reading documentation on arduino libraries, because you can follow the programming logic in a different way.


long story short, to write in I2C, you need to use at least 2 position array (the first[0] to set register address, the second[1] to send the value
to read, first you write nothing to desired register, then you read the amount of data from the pointed one to get results.

Take as example the LINX functions for MPU60X0, put the open.vi, read.vi and close.vi in your block diagram. Open those VIs and see what are they doing in within the block diagram.

LabVIEW is a graphical programming language, but still a programming language, that calls other functions, that calls olhers, and so on.

 




Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 2 of 2
(942 Views)