Hi, If you use the default configuration, the bmi160's API will provide the output in units of LSB. The default configuration of bmi160 is +/- 2g and resolution = 0.061mg/LSB. (The resolution is determined by the hardware and range, which is the minimum value that the sensor can measure.) In this case, the obtained sensor output can be directly used as bsxlite input. As a result, it is reasonable to use LSB(0.061 mg) as the input unit of bsxlite. BMI160 has different sensitivity for different range configuration. For example, Default configuration: ACC: +/- 2g, output = 1 LSB = 0.061 mg; GYRO: +/-500 dps, the input gyro data unit =1 LSB = 500dps/16384 = 0.0153 dps. Then, bmi160_get_sensor_data(&acc_x, &acc_y, &acc_z, &gyr_x, &gyr_y, &gyr_z); libraryInput_ts.acc.data.x = acc_x; libraryInput_ts.acc.data.y = acc_y; libraryInput_ts.acc.data.z = acc_z; libraryInput_ts.gyro.data.x = gyr_x;libraryInput_ts.gyro.data.y = gyr_y;libraryInput_ts.gyro.data.z = gyr_z; Other configurations: ACC: +/- 4g, output = 1 LSB = 0.12 mg; GYRO: +/-1000 dps, the input gyro data unit =1 LSB = 1000dps/16384 = 0.03 dps. bmi160_get_sensor_data(&acc_x, &acc_y, &acc_z, &gyr_x, &gyr_y, &gyr_z); libraryInput_ts.acc.data.x = 2*acc_x; libraryInput_ts.acc.data.y = 2*acc_y; libraryInput_ts.acc.data.z = 2*acc_z; libraryInput_ts.gyro.data.x = 2*gyr_x;libraryInput_ts.gyro.data.y = 2*gyr_y;libraryInput_ts.gyro.data.z = 2*gyr_z; Note that the user has to ensure that the input units are correct, or bsxlite will not give the correct outputs.
... View more