Hi
i have LIS2DH working ok just having problem with the order of return values, maybe just a quick fix.
LIS2DH is running on 10Hz, low power mode, I receive interrupt once it’s FIFO is full and read the registries using autoincrement:
uint8_t reg[1] = {(0x80 | 0x28)};
ret_code_t err_code = nrf_drv_twi_tx(&m_twi, ACCEL_ADDR, reg, sizeof(reg), true);
Once FIFO is full I read values from registry:
ret_code_t err_code = nrf_drv_twi_rx(&m_twi, ACCEL_ADDR, m_sample, sizeof(m_sample));
expecting values to be returned in the same order as registry (X_L, X_H, Y_L, Y_H, etc)
it seems the values are ordered ok but order is shifting left for each read. Here are raw x, y and z returned. X and y are in 60k range as the sensor is laying flat on the desk. Z is 16k as gravity is pulling it down.
<info> app: RX event done 61568, 64000, 16256
<info> app: RX event done 64000, 16384, 61824
<info> app: RX event done 16256, 61760, 64064
<info> app: RX event done 61760, 64064, 16320
<info> app: RX event done 64064, 16384, 61760
<info> app: RX event done 16192, 61632, 63872
does anyone know what am I doing wrong?
Thanks