Magnetometer and accelerometer test