LSM9DS1 motion detection functions
Hello! I tried to work with motion detection function and here is my setup of interrupt pin
/* Interrupt pin setup */
lsm9ds1_pin_notification_set(MAG_I2C_ADD, IMU_I2C_ADD, LSM9DS1_INT_PULSED);
lsm9ds1_pin_polarity_set(MAG_I2C_ADD, IMU_I2C_ADD, LSM9DS1_ACTIVE_HIGH);
lsm9ds1_pin_logic_set(IMU_I2C_ADD, LSM9DS1_LOGIC_AND);
lsm9ds1_pin_mode_set(MAG_I2C_ADD, LSM9DS1_PUSH_PULL);
lsm9ds1_pin_mode_set(IMU_I2C_ADD, LSM9DS1_PUSH_PULL);
lsm9ds1_pin_m_route_t int_m;
int_m.ien = 1;
lsm9ds1_pin_int_m_route_set(MAG_I2C_ADD, int_m);
lsm9ds1_pin_int1_route_t pin_cfg;
pin_cfg.int1_drdy_g = 1;
pin_cfg.int1_drdy_xl = 1;
pin_cfg.int1_ig_g= 1;
pin_cfg.int1_ig_xl= 1;
lsm9ds1_pin_int1_route_set(IMU_I2C_ADD, pin_cfg);
/* Set Output Data Rate / Power mode */
ret = lsm9ds1_imu_data_rate_set(IMU_I2C_ADD, LSM9DS1_IMU_119Hz); //LSM9DS1_IMU_119HzBut I get completely chaotic condition of interrupt PIN even I don't touch the accelerometer.
Could you give me an example how to setup motion detection function?
Thanks!
