BMX160 getting decimals through getAllData on arduinos
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!
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!