Skip to main content
Visitor II
November 28, 2022
Question

How I do I2C Connect for the ISM330DHCX sensor

  • November 28, 2022
  • 2 replies
  • 1483 views

* Initialize the LSM6DSL sensor */

LSM6DSL_Init(&MotionSensor);

/* Configure the LSM6DSL accelerometer (ODR, scale and interrupt) */

LSM6DSL_ACC_SetOutputDataRate(&MotionSensor, 26.0f); /* 26 Hz */

LSM6DSL_ACC_SetFullScale(&MotionSensor, 4); /* [-4000mg; +4000mg] */

LSM6DSL_ACC_Set_INT1_DRDY(&MotionSensor, ENABLE); /* Enable DRDY */

LSM6DSL_ACC_GetAxesRaw(&MotionSensor, &axes); /* Clear DRDY */

this code is used for another gyroscope in the example in the link. I'm trying to use this code for my im330dhcx but these parts are getting errors in CubeIde. How can I solve it? (I am the version I adapted io_ctx . BusType   = ISM330DHCX_I2C_BUS;

 io_ctx . Address   = ISM330DHCX_I2C_ADD_L;

 io_ctx . Init    = HAL_I2C2_Init;

 io_ctx . DeInit   = HAL_I2C_DeInit;

 io_ctx . ReadReg   = HAL_I2C_ReadReg;

 io_ctx. WriteReg  = HAL_I2C2_WriteReg;

 io_ctx . GetTick   = BSP_GetTick;)

    This topic has been closed for replies.

    2 replies

    nadzaAuthor
    Visitor II
    November 28, 2022
    Visitor II
    December 22, 2022

    Hi,

    I have the same problem. Have you found a solution?

    Best

    P