sparkfun/SparkFun_LSM9DS1_Arduino_Library

Calibration example

marcwitteveen opened this issue · 1 comments

How do you use the calibration method? I call the method calibration but there is still offset and drift... anybody have a code example?

Hi, I guess is a llitle bit late but here's how I got the calibration to work

void setup() {
  Serial.begin(115200);

  Wire.begin(32, 33);

  imu.settings.device.commInterface = IMU_MODE_I2C;  // Set mode to I2C
  imu.settings.device.mAddress = LSM9DS1_M;          // Set mag address to 0x1E
  imu.settings.device.agAddress = LSM9DS1_AG;        // Set ag address to 0x6B

  if (imu.begin() == false) {
    Serial.println("Failed to communicate with LSM9DS1.");
    while (1)
      ;
  }

  imu.calibrate(true);

}