11-29-2020 12:19 PM
Hi,
I am using a BMI160. I am struggling to convert the sensortime into [ms] from the raw value. Could you help me with this please?
Many thanks
Katie
11-30-2020 03:42 AM
Helo,
We have api to calculate sensor time, from lsb to sec, as bellow. Sensortime increments with 39.0625us, please check reg 0x18-0x1A, 2.11.5 of datasheet.
/*!
* @brief This internal API is used to convert ticks to seconds
*
* @param[in] sensor_time
*
* @return float value in seconds
*
*/
float sensor_ticks_to_s(uint32_t sensor_time)
{
return (float)sensor_time * 0.0000390625f;
}
float sensor_ticks_to_ms(uint32_t sensor_time)
{
return (float)sensor_time * 0.0390625f;
}