Hi xuchang and thanks for replying. I still don't quite understand how this should work. I fetch the sensor data with the BMI160 API using 'bmi160_get_sensor_data'. This function returns a bmi160_sensor_data structs, which contains the members int16_t x, int16_t y, int16_t z, and uint32_t sensortime. The x-value for the accelerometer can be converted to a value in g by knowing the set range and thereby the resolution. BSXLite's 'bsx_dostep' expects type 'libraryinput_t' as input, which has the member 'sensordata_t acc', which itself has the members 'ts_dataxyzs32 data' and 'unsigned int (32Bit) time_stamp', where 'ts_dataxyzs32' consists of the members x,y and z in signed int (32Bit). If 'bmi160_get_sensor_data' returns a reading of e.g. 10 for acc.x, which is at a range of +/- 2g and resolution = 0.061mg/LSB , this means we have 0.61mg measured by the sensor in x-axis. How am I supposed to give this float value as an input to the bsx_dostep-function,that needs a signed int-input? On the other hand, if I assume bsxlite needs accelerometer input in unit g and then pass the int16_t x-value fetched from bmi160_get_sensor_data to the bsxLite library (bsx_dostep), how does the library know if this value is measured in a resolution of 0.061mg/LSB (+/- 2g) or e.g. 0.122mg/LSB for +/- 4g? Thanks a lot for helping me out with this and have a great day. Best regards, George
... View more