ArduinoGeneral

BMX160 getting decimals through getAllData on arduinos

userHead Account cancelled 2022-01-13 00:47:10 638 Views0 Replies
Hello, I got my sensor working and getting all the data that I should except for one small problem. I cannot figure out how to get non rounded number.

Using bmx160SensorData to create my variables to store my data works and creates long_ints successfully, but then using bmx160.getAllData(...) only sends rounded number to them.

For example after using
bmx160SensorData accel;
bmx160.getAllData(NULL, NULL, &accel);
I'm expecting my z value (accel.z) to be 9.81 while the sensor is laying flat, but unfortunalely it gets rounded up to 10.

Is there any way I can get getAllData to output the full value? If there isn't, is there a way on arduino to get the raw LSB/g data that I can then convert myself?

Thanks so much for the help!