Reading Pitch Roll from ultimate imu (LPC 2148)

hello I also have an ultimate imu, and a mega arduino
my problem is I do not know how to implement the program in the LPC2148 to calculate the angles and how to read angles in the arduino to implement a fuzzy controller
if you have any solutions