I thought I might just upload some code since I took along time to figure this one out. I acquired a 10-DOF IMU, which has a L3GD20H, LSM303 and BMP180, from Adafruit which does not have support anymore and I desperately wanted to make a compass. So I found this post:
With this I managed to properly calibrate my IMU. However, I wasn’t happy with the heading indicator. So I saw that Paul Stoffregen has made a Mahony and Madgwick filter. What I realized though is that it is not compatible with all IMU’s, so with some tweaks I managed to make it compatible with the 10-DOF.
So in case anyone is interested, here it is.
Please note: I am just a beginner and I just want to help anyone that has the same headache as I had trying to figure this one out. Also, if there is anyway to make it even better, let me know ;).
10DOF_Filter.ino (2.7 KB)