Skip to main content
Visitor II
July 30, 2018
Question

Reading data from H3LIS331DL

  • July 30, 2018
  • 1 reply
  • 775 views

I was wondering about the format of the data from the H3LIS331DL accelerometer. At +/-400 scaling, 0.195 is listed as the scaling factor (in G). However, the data appears to be only 12-bit, left justified, since the lower 4 bits are always zero. After multiplying the result by 0.195, does it also need to be right-shifted 4 bits? If this isn't done, the stock G values at rest are quite high, anywhere from 5-10 G.

    This topic has been closed for replies.

    1 reply

    Graduate II
    August 10, 2018

    Well (32767 * 0.195) / 16 = 399.36

    I'd assume it is left justified to maintain the sign in an int16_t manipulation