Here is an example for how to calibrate the acceleration and magnetometer in MPU9250. The main.cpp is code written for STM32f108, but it should work with Arduino as I use the Arduino framework. The ...