ADXL 335 ANGLE MEASUREMENT USING ARDUINO UNO

Can any one give me the complete code to get angle in degrees while rotating the sensor wrt 3 axis along with calibration?How to calibrate the sensor so that i dont get any random values each time.

I am using breadboard to connect the sensor.
taking 3.3 v from arduino.

plz guide.

I wrote a code but it lacks calibration.

ADXL 335

ARDUINO UNO

FINAL_CODEEEE.ino (1.18 KB)