We do not have an example sketch for displaying the heading for the AltIMU-10 v5. Calculating the heading requires both the accelerometer and magnetometer, so you will have to utilize readings from both the LSM6DS33 and LIS3MDL. You can look at the LSM303 header file for details on the algorithm for calculating the heading.
If you run into any issues, you can post your code here and I would be happy to take a look.
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.
Thank you very much, Jim for your help and try to solve my problem. The Balboa solution does not work for me because my application is running on Teensy 4.0. This is the error:
Balboa32U4.h: 13: 2: error: #error "This library only supports the ATmega32U4.
Thanks Jeremy, I don’t have enough level and time to adapt the program with the help of the “LSM303 header file”.
I think the simplest thing is going to be to resort to another more powerful system to do the calculations, such as the:
"BNO055 Intelligent 9-axis absolute orientation sensor " from Bosch.
You don’t need the Balboa library to run the basic compass code. It is needed only for the LCD display.
But do you have ANY libraries for those sensors that work with the Teensy 4.0?
BTW the BNO055 is convenient, but it really does not work very well. The sensor calibration is crude and unstable, so don’t expect heading accuracy better than about +/- 5 to 10 degrees.