sparkfun / SparkFun_ICM-20948_ArduinoLibrary

Arduino support for ICM_20948 w/ portable C backbone
Other
160 stars 69 forks source link

Storing and setting Compass Calibraiton #137

Closed nyfelix closed 8 months ago

nyfelix commented 8 months ago

Dear Team,

first of all thank you for the development efforts. This seems to be the only available library that manages to handle the DMP. As I understand the ICM-20949 does self-calibration and using the Example6_DMP_Quat9_Orientation.ino sketch I can observe that the orientation stabalizes after few seconds of moving the sensor.

No I want to store the calibration and set it at starup of my firmware (so not moving of the sensor is required). From what I understood the following code will output the current calibraiton:

icm_20948_DMP_data_t data;
myICM.readDMPdataFromFIFO(&data);
Serial.print(data.Compass_Calibr.Data.X);

Is there any method that allows me to set this calibraiton at startup?

Best, Felix

PaulZC commented 8 months ago

Hi Felix (@nyfelix ),

Please see this example. It is ESP32-specific; the biases are stored in ESP32 EEPROM. Please adapt the storage to match your platform.

Best wishes, Paul

nyfelix commented 8 months ago

Perfect! That worked :-) Sorry I did not see the example myself.

PaulZC commented 8 months ago

No worries Felix - glad that's working for you. Best, Paul