At the end of this tutorial: Correcting the Balboa magnetometer
I posted code for a tilt compensated compass using the LIS3MDL magnetometer and the LSM6DS33 accelerometer on the Balboa robot. It may work “out of the box” with the AltIMU10V5, but if not, it should be rather easy to make any changes required.
Download the Arduino code, Balboa_compass2.zip at https://forum.pololu.com/uploads/default/original/2X/5/5fe1cc2523ed554e6271a7426eb1795c19ea29f9.zip
You will need to calibrate at least the magnetometer for the compass to be at all useful, so consult the above tutorial.
