ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lsm303 read data

hi, i'm Vincenzo, an electronic engineering. I'm realizing a work about LSM303, accelerometer and magnetometer, I've to work with Arduino and Labview: can someone help me with the implementation of the .vi to read acceleration data and magnetic field data into two graphs?

Thank you for the answers.

Regards

0 Kudos
Message 1 of 5
(3,485 Views)

Hi Vincenzo,

 

I can send you a typical example to read an analog input from Arduino with Labview through "NI Labview Interface for Arduino Toolkit". Starting from this example you'll can modify it for your purpose. Have a good time!

 

Enzo

AE Senior

 

0 Kudos
Message 2 of 5
(3,458 Views)

Thank you so much. I'll try to learn how to use these two powerful instruments, Arduino and Labview.

I wish I can ask something else if I'll need it!

Best regards.

 

0 Kudos
Message 3 of 5
(3,449 Views)

Hi! Working and studying various documentation about this sensor, I've found a sketch for Arduino. I've a question: why getLSM303_accel and getLSM303_mag functions are realized in two different ways? I would understant to be able to interpretate this code. These are the function:

 

void getLSM303_mag(int * rawValues)
{
  Wire.beginTransmission(LSM303_MAG);
  Wire.write(OUT_X_H_M);
  Wire.endTransmission();
  Wire.requestFrom(LSM303_MAG, 6);
  for (int i=0; i<3; i++)
    rawValues[i] = (Wire.read() << 8 ) | Wire.read();
}

void getLSM303_accel(int * rawValues)
{
  rawValues[Z] = ((int)LSM303_read(OUT_X_L_A) << 8 ) | (LSM303_read(OUT_X_H_A));
  rawValues[X] = ((int)LSM303_read(OUT_Y_L_A) << 8 ) | (LSM303_read(OUT_Y_H_A));
  rawValues[Y] = ((int)LSM303_read(OUT_Z_L_A) << 8 ) | (LSM303_read(OUT_Z_H_A));

 

I thought to realize in egual ways these void.

Thanks, regards

0 Kudos
Message 4 of 5
(3,324 Views)
How is your question related to LabVIEW? Shouldn't you be posting to an Arduino forum?
0 Kudos
Message 5 of 5
(3,316 Views)