Open gunarkroeger opened 3 years ago
These are the ways I tried, by reading the registers directly and the values from the struct. but neither update after it gets calibrated
uint8_t reg_g_offset[6];
uint8_t reg_a_offset[6];
int result = 0;
//Gyro offset
result |= inv_icm20948_read_mems_reg(s, REG_XG_OFFS_USRH, sizeof(reg_g_offset), reg_g_offset);
//Accel offset
result |= inv_icm20948_read_mems_reg(s, REG_XA_OFFS_H, 2, ®_a_offset[0]);
result |= inv_icm20948_read_mems_reg(s, REG_YA_OFFS_H, 2, ®_a_offset[2]);
result |= inv_icm20948_read_mems_reg(s, REG_ZA_OFFS_H, 2, ®_a_offset[4]);
Serial.println("g_offset");
for(unsigned i = 0; i < 6; i++)
Serial.print(String(reg_g_offset[i]) + " ");
Serial.println("");
Serial.println("a_offset");
for(unsigned i = 0; i < 6; i++)
Serial.print(String(reg_a_offset[i]) + " ");
Serial.println(String("result:") + result);
Serial.println("bias");
for(unsigned i = 0; i < 9; i++)
Serial.print(String(s->bias[i]) + " ");
Serial.println("");
Serial.println("soft_iron_matrix");
for(unsigned i = 0; i < 9; i++)
Serial.print(String(s->soft_iron_matrix[i]) + " ");
How do I read the calibration from the imu, so that I can save it to an external flash and write it back onto the sensor on power up?