How to analyze the data of BMI270

Hallo everyone

I have obtained the originaldata from BMI270, but  these data are not processed. How to convert these data into data with standard units. For example: m/s^2  (accelerometer) and rad/s (gyroscope).

Thank you very much.

Accel_xAccel_yAccel_zGyr_xGyr_yGyr_z19-4261666014110-421166461412-43816671231205-5801667503-22-81888917469131-537-1282022-59116579333-937783457151117143961-971772104444715315849173-113-1136224156043838805-1441498015571-2761401-454-3889420614484-785900-792-600177216052-1714-758-587-3700-40216576-1230-909-234-3414-373817029-896-13801271718-284216151836-9041892032787185601090-179217
Best reply by BSTRobin

Hello Eason,

There were example code in github.

For accelerometer,  you could example file "https://github.com/BoschSensortec/BMI270-Sensor-API/blob/master/examples/bmi270/accel/accel.c".

/*!
* @brief This function converts lsb to meter per second squared for 16 bit accelerometer at
* range 2G, 4G, 8G or 16G.
*/
static float lsb_to_mps2(int16_t val, float g_range, uint8_t bit_width)
{
float half_scale = ((float)(1 << bit_width) / 2.0f);

return (GRAVITY_EARTH * val * g_range) / half_scale;
}

For gyroscope, you could example file "https://github.com/BoschSensortec/BMI270-Sensor-API/blob/master/examples/bmi270/gyro/gyro.c".

/*!
* @brief This function converts lsb to degree per second for 16 bit gyro at
* range 125, 250, 500, 1000 or 2000dps.
*/
static float lsb_to_dps(int16_t val, float dps, uint8_t bit_width)
{
float half_scale = ((float)(1 << bit_width) / 2.0f);

return (dps / ((half_scale) + BMI2_GYR_RANGE_2000)) * (val);
}

View original
1 reply
Resolved