I'm starting a new design and want to use the BMX160, but can't find the driver.
I've looked on the Bosch Sensortec GitHub page, but there is no driver there. https://github.com/BoschSensortec
The BMI160 driver is available on GitHub, but doesn't seem to be compatible with the BMX160.
Does anyone know where to download/clone the BMX160 driver?
Solved! Go to Solution.
At the moment we don't have a dedicated BMX160 driver released, but in the meantime you may reuse the BMI160 and BMM150 drivers. You will have to change the chip id in the bmi160_defs.h file to 0xD8. In addition, you can refer to example code here on how to configure the device and read out data from all 3 sensors.
Hope this helps.
I found the example code in github(https://github.com/BoschSensortec/BMI160_driver/wiki/How-to-use-an-auxiliary-sensor-or-magnetometer-...), but I feel confused about the code.
The while loop in the example:
rslt = bmi160_set_fifo_config(fifo_config, BMI160_ENABLE, &bmi); /* Check rslt for any error codes */
while(rslt != 0)
Why the loop could run when the variable "rslt" is not zero?
I'll try this
rslt is the return result after each sensor read.
When rslt==0, the sensor is in an error state. This allows you to handle sensor errors.
In the WIKI example, the error is used to ensure no incorrect data is used in the program. If there are any errors, the program exits.