I have an ESP32 connected to a LSM9DS1. I am using the SparkFun LSM9DS1 library available at GitHub - sparkfun/SparkFun_LSM9DS1_Arduino_Library: Arduino library for the LSM9DS1 9DOF IMU..
I am using it to calculate pitch and roll.
The library has a method calibrate(true); which I trigger on a press of a button... but returned data is sometimes 0 degrees, next press it can be 20 degrees... the sensor is on a solid table and does not move 20 degrees when the button is pressed,
In the incode documentation it says:
This is a function that uses the FIFO to accumulate sample of accelerometer and gyro data, average them, scales them to gs and deg/s, respectively, and then passes the biases to the main sketch for subtraction from all subsequent data. There are no gyro and accelerometer bias registers to store the data as there are in the ADXL345, a precursor to the LSM9DS0, or the MPU-9150, so we have to subtract the biases ourselves. This results in a more accurate measurement in general and can remove errors due to imprecise or varying initial placement. Calibration of sensor data in this manner is good practice.
I am a bit puzzled what I need to do with the main sketch... which values should I get because the method returns no data... could anybody help me with a code example or a push in the right direction?