Using the L3G4200D and LSM303DLM to get a precise angle

I have the Pololu L3G4200D and LSM303DLM breakout boards and I am trying to measure the angle of the arduino at any given time. I don't want to know how fast it is rotating, but rather what angle it is at. I have used the miniIMU9 sample code and python program and that all works great. I just need it to output the angle to an LCD screen, but the code in the miniIMU9 program is really confusing!

Any suggestions on where to start?

Thank you!

The L3G4200D is just a gyroscope (angle speed meter), which doesn't provide absolute measurements.

The LSM303DLM is a combined accelerometer and digital compass. The accelerometer doesn't help you but the compass might do better. If you're using your Arduino application outdoors you usually get quite accurate results. Inside of buildings (at least here in Europe where a building is more than a bit of wood) the measurement may be quite inaccurate because surrounding concrete with steel inside is influencing the magnetic sensor.

If you used sample code and you're not confident with it, you should have provided at least a link to it.