I have an ITG3200 gyroscope working well. Each time through the loop, I am reading the deg/sec measurements from each of the 3 axis (x, y and z) separately. I multiply by the time between readings to get a total angle turned (in any of these axis). These measurements appear to be correct when I rotate the itg3200 on one of its axes at a time.

When I rotate the gyro about its Y axis, then rotate it about the axis parallel to the direction of the force due to gravity (where the Z axis would have been if I had not rotated it about its Y axis first), I no longer get the value of the rotation about the axis parallel to the direction of the force due to gravity.

I want to be able to determine my orientation with respect to the axis parallel to the direction of the force due to gravity, i.e. straight down regardless of my orientation about the X and Y axis.

I have been googling this for a couple hours, and am seeing lots of discussion about using quaternions and/or Eulers angles to calculate this, but my college physics is rusty (and I don't believe I've ever dealt with either of those things).

Is there a simple trig solution to this (like, take the cosine of the angle about the y axis and multiply that with the net reading of my 'Z' orientation), or is this more complicated?