AltIMU-10 v4 sensor programming with arduino

Hi i am working with the altIMU board to display attitude and heading information similar to that of an attitude indicator. I merged the 3 sensor program codes which i obtained from a forum to display the data on the arduino serial monitor. The program which i am using to display the pitch and roll (attitude) data starts to display nan after a short while when the program is run and i have no idea why. Any help would be great guys. Ill attach the links to where i code the various codes as well as codes.

Vector.ino (1.84 KB)

sketch_dec05b.ino (7.24 KB)

Output.ino (2.71 KB)

matrix.ino (1.55 KB)

I2C.ino (2.72 KB)

DCM.ino (6 KB)

Compass.ino (1.97 KB)

Anybody got solution for this? I'm facing the same issue too!

I recommend using RTImulib with that sensor. It should work "out of the box" provided you make the correct defines, and it is far superior to the bits and pieces the OP cobbled together.