2022-05-20 09:14 AM
2022-05-27 07:13 AM
Hi @NAsma.1 ,
A fast solution could be use the Unicleo-GUI for the IKS01A1 interface and to change the ODR settings there..
For a code-level interaction with the LSM6DS0 device, unfortunately, the X-NUCLEO-IKS01A1 is no longer support by ST. However, you can try to use the X-CUBE-MEMS1 package, and in particular the examples related to the IKS01A2 and the sensor_commands.c
**
* @brief Set sensor output data rate
* @param Msg the pointer to the message to be handled
* @retval 1 if the message is correctly handled, 0 otherwise
*/
static int SC_Set_ODR(TMsg *Msg)
{
float odr = 0.0f;
int ret = 1;
ArrayToFloat(&Msg->Data[5], &odr);
/* Sensor Type */
switch (Msg->Data[4])
{
case SC_ACCELEROMETER:
if (IKS01A2_MOTION_SENSOR_SetOutputDataRate(AccInstance, MOTION_ACCELERO, odr) != BSP_ERROR_NONE)
{
return 0;
}
break;
case SC_GYROSCOPE:
if (IKS01A2_MOTION_SENSOR_SetOutputDataRate(GyrInstance, MOTION_GYRO, odr) != BSP_ERROR_NONE)
{
return 0;
}
break;
case SC_MAGNETOMETER:
if (IKS01A2_MOTION_SENSOR_SetOutputDataRate(MagInstance, MOTION_MAGNETO, odr) != BSP_ERROR_NONE)
{
return 0;
}
break;
case SC_TEMPERATURE:
if (IKS01A2_ENV_SENSOR_SetOutputDataRate(TmpInstance, ENV_TEMPERATURE, odr) != BSP_ERROR_NONE)
{
return 0;
}
break;
case SC_HUMIDITY:
if (IKS01A2_ENV_SENSOR_SetOutputDataRate(HumInstance, ENV_HUMIDITY, odr) != BSP_ERROR_NONE)
{
return 0;
}
break;
case SC_PRESSURE:
if (IKS01A2_ENV_SENSOR_SetOutputDataRate(PrsInstance, ENV_PRESSURE, odr) != BSP_ERROR_NONE)
{
return 0;
}
break;
default:
ret = 0;
break;
}
It is not a plug-and-play solution, it has to be adapted to IKS01A1 devices.
-Eleon
2022-05-30 04:07 AM
Thank you so much,
2022-05-30 04:29 AM
Is there any way i can recuperate the tilt angles without using the unicleoGUI, a code-level interaction i mean ( since LSM6DS0 provides acceleration and angular velocity ) ?