     Finds the calibration constant of the
     gyro.
     @param number of calibration samples
+    @returns degrees of gyro drift per second
 */
-int zeroGyro(int calibrationSamples) {
-  float zSum = 0;
+float zeroGyro(int calibrationSamples) {
+  float gyroSum = 0;
   digitalWrite(LED, HIGH);
   for (int i = 0; i < calibrationSamples; i++) {
-    imu.readGyro();
-    float z = imu.calcGyro(imu.gz);
-    zSum += z;
-    delay(5);
+    gyroSum += readGyro();
   }
   blinkLED(300, 5);
-  return zSum / calibrationSamples;
+  Serial.println(gyroSum / calibrationSamples);
+  return gyroSum / calibrationSamples;
 }
 
 /**

// ============ Runtime variables ========================
// Orientation data
float positionChange;

// Interrupt flag
int timer = millis();
bool update_flag = false; // interrupt flag for executing motor update

/**
    Sets up system
*/

// ================ SYSTEM PARAMETERS ===================
// Sample rates
const int motorUpdateRate = 50; // gyro sample rate
const int calibrationSamples = 1000;

// Initial calibration value
float calibratedOffset;

// Indicator LED
const int LED = 13;
