This is a mixed bag library for compass and accelerometer fusing...
The three main parts are:
1) Compass Hard Iron Offset Auto-Solver
2) Accelerometer Yaw Pitch & Roll Calculator
3) 360Â° Compass Tilt Compensation
The auto solver is a Gaussian elimination solver requiring at least 6 datasets, the code included will filter and capture 8 datasets around the sphere and compute the best solution possible. Tilt compensation is not angle limited, it will compensate in any orientation.
The library, a more complete description and a 3D scatter plot video are here: