How to get x, y, and z axis values at single command in LIS2DH12 through I2C?
I've attempted to get values at x, y, and z axes at once, but it doesn't work well.
What I want to do is to check if a device where the LIS2DH12 is populated stays still or moves. So I need to get x, y, and z values.
So far, I read each value by each in a bypass mode, like first read x value, then y value, and finally z value. It's redundant and I want to read it at one-shot command.
I read 6 bytes from OUT_X_L (28h) and stored them to rx_buf[6]. The result should be
OUT_X_L(28h) = rx_buf[0]
OUT_X_H(29h) = rx_buf[1]
OUT_Y_L(2Ah) = rx_buf[2]
OUT_Y_H(2Bh)= rx_buf[3]
OUT_Z_L(2Ch) = rx_buf[4]
OUT_Z_H(2Dh) = rx_buf[5]
However, all the values in rx_buf are 0.
Which mode should I use. How can I read x, y, and z values at one time?
