cancel
Showing results for 
Search instead for 
Did you mean: 

I have a LSM303AHTR Mag/Accel burned on a board located in a whiffle ball and need to turn the 3-axis data into feet and inches?

Mgans.1
Associate
 
1 ACCEPTED SOLUTION

Accepted Solutions
TSand.1
Associate III

Hi, you just have to apply first the conversion from LSB into milli -g, as for example described in the https://github.com/STMicroelectronics/lsm303ah/blob/master/lsm303ah_reg.c

float_t lsm303ah_from_fs2g_to_mg(int16_t lsb)
{
  return ((float_t)lsb * 0.061f);
}

Since a milli-g is 10^-3 * 9.81m/s^2, if you want inches or feet you have to apply the conversion from meter into the target units:

  • Feet: 32.2 feet/s^2
  • Inches: 386.2 inches/s^2

View solution in original post

1 REPLY 1
TSand.1
Associate III

Hi, you just have to apply first the conversion from LSB into milli -g, as for example described in the https://github.com/STMicroelectronics/lsm303ah/blob/master/lsm303ah_reg.c

float_t lsm303ah_from_fs2g_to_mg(int16_t lsb)
{
  return ((float_t)lsb * 0.061f);
}

Since a milli-g is 10^-3 * 9.81m/s^2, if you want inches or feet you have to apply the conversion from meter into the target units:

  • Feet: 32.2 feet/s^2
  • Inches: 386.2 inches/s^2