Tinkerkit Gyroscope: Issue with calculating angles from raw data.

Good Afternoon All.

I am really hoping that you can help me with this. I am trying to convert the data from a Tinkerkit Gyroscope (http://www.tinkerkit.com/gyroscope-4x/) into a corresponding angle rotation.

The problem I am having is that when I rotate the gyroscope about 90 degrees it will only show a 45 degree rotation. It is my aim to join this gyroscope with the accelerometer once this is sorted to calculate usable position data.

I am fairly new to Arduino and writing code in general, so I apologise now if the following sketch is messy (note this does include the tinkerkit library):

#include <TinkerKit.h>

TKGyro gyro(I0, I1, TK_X4);  

// Timing variables
unsigned long time;
int sampleTime = 10;

// Gyro variables
float rollADC, pitchADC;
float rollZeroADC = 0, pitchZeroADC = 0;
float rollRate, pitchRate;
float prev_rollRate = 0, prev_pitchRate = 0;
float rollAngle = 0, pitchAngle = 0;

// Accuracy variables
float correctionX = 0, correctionY = 0;
float Threshold = 8;
float cal = 100;
float sensitivity = 0.137;

void setup() 
{
  // initialize serial communications at 115200 bps
  Serial.begin(115200);
  
  // Calibrate Gyro
  gyro.calibrate();

  // Find Zero Point
  for (int i=0; i<cal; i++)
  {
    correctionX += gyro.readX(); 
    correctionY += gyro.readY();
  }
  pitchZeroADC = correctionX/cal;
  rollZeroADC = correctionY/cal;
  
  // Print Zero Point
  Serial.print("Zero Gyro X = " );                       
  Serial.print(pitchZeroADC);   
  Serial.print("\t\t\t\t Zero Gyro Y = " );                       
  Serial.println(rollZeroADC);
}

void loop()
{
  // Every 10 ms take a sample from the gyro
  if(millis() - time > sampleTime)
  {
    time = millis();
    
    // Print Read Time
    Serial.print("Time: ");
    Serial.print(time);
    
    // Read Gyro Values
    pitchADC = gyro.readX();
    rollADC  = gyro.readY();
    
    // Calculate Rotation Rates
    pitchRate = (pitchADC - pitchZeroADC)/sensitivity;
    rollRate = (rollADC - rollZeroADC)/sensitivity;
    
    // Apply Threshold and Calculate Angle
    if(pitchRate >= Threshold || pitchRate <= -Threshold)
      pitchAngle += (prev_pitchRate + pitchRate) * sampleTime / 2000;
    
    if(rollRate >= Threshold || rollRate <= -Threshold) 
      rollAngle  += (prev_rollRate + rollRate) * sampleTime / 2000;
    
    // Assign Rate for later recall
    prev_pitchRate = pitchRate;
    prev_rollRate = rollRate;
    
    // Check Angle +ve
    if (rollAngle < 0)
      rollAngle += 360;
    else if (rollAngle > 359)
      rollAngle -= 360;
  
    if (pitchAngle < 0)
      pitchAngle += 360;
    else if (pitchAngle > 359)
      pitchAngle -= 360;
    
    // print the results to the serial monitor:
    Serial.print("Roll_ADC: ");
    Serial.print(rollADC);
    Serial.print("\tRoll_Rate: ");
    Serial.print(rollRate);
    Serial.print("\tRoll_Angle: ");
    Serial.println(rollAngle);
    Serial.print("\tPitch_Rate: ");
    Serial.print(pitchRate);
    Serial.print("\tPitch_Angle: ");
    Serial.println(pitchAngle);     
  }    
}

A couple of points to note:
-I am running this on a ArduinoMEGA with a tinkerkit shield.
-The 'sensitivity' value is calculated from the datasheet LPR5150AL found here (http://www.tinkerkit.com/gyroscope-4x/) using the calculation here (Guide to gyro and accelerometer with Arduino including Kalman filtering - Sensors - Arduino Forum).

I believe that the issue has something to do with either the sensitivity value or the timing used (or something very obvious which I cannot see), but after a lot of time spent on this I can't figure it out.

I have done a lot of searching around this but found surprisingly little information (I could however just be bad at searching).

Any information you could supply on the issue would be greatly appreciated.

Thanks