02-08-2022 08:56 PM
I am working on BMX160 using I2C, I can get the data of Accel but can't get any valid Magnetometer data. I found that almost all the examples using bmm150 to get this data. https://github.com/BoschSensortec/BMI160_driver/wiki/How-to-use-an-auxiliary-sensor-or-magnetometer-.... and https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/BMX160-magnetometer-problem/td-p/7628/pa... , but I found some defines in bmm150_def.h are not the same as the datasheet of BMX160. For example :
Solved! Go to Solution.
02-17-2022 02:11 PM
Hi Minhwan,
Thank you.
Be careful the face of our product is not level. so the data might be not accurate.
Best
02-18-2022 02:14 AM
Hello,
You can't directly use Mag register value. Please use my example code.
Technically, if you want to read Mag data from BMX160, you need to follow 2.4.3 Data processing Magnetometer.
https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmx160-ds0001.pdf
If you are testing your own board, the mag data value can be affected by your environment.
To verify it, one of easiest way is to convert the mag data to heading value, and check it.
Therefore, it's difficult to verify your mag data.