 }
 
 /**
-    Reads the IMU's gyro
-    @return rate in degrees / ms
-*/
-float readGyro() {
-  if (imu.gyroAvailable()) {
-    imu.readGyro();
-  }
-  return imu.calcGyro(imu.gz) - calibratedOffset;
-}
-
-/**
     Blinks an LED on pin 13
     @param delay in milliseconds
     @param number of blinks

    byte negative = 0;
    if (Serial.read() == '1') negative = 1;
    for (int i = 100; i >= 1; i /= 10) {
      correctionFactor += (Serial.read() - '0') * 100;
    }
    if (negative) correctionFactor = -correctionFactor;
    rotateStepperBy(correctionFactor);

  imu.settings.device.mAddress = LSM9DS1_M;
  imu.settings.device.agAddress = LSM9DS1_AG;
  while (!imu.begin()) {
    blinkLED(1000, 1);
  }
  blinkLED(50, 15);
}

/**
    Reads the IMU's gyro
    @return rate in degrees / ms
*/
float readGyro() {
  if (imu.gyroAvailable()) {
    imu.readGyro();
  }
  return imu.calcGyro(imu.gz) - calibratedOffset;
}

/**
    Finds the calibration constant of the
    gyro.
    @param number of calibration samples
*/
int zeroGyro(int calibrationSamples) {
  float zSum = 0;
  for (int i = 0; i < calibrationSamples; i++) {
    imu.readGyro();
    float z = imu.calcGyro(imu.gz);
    zSum += z;
    delay(10);
  }
  return zSum / calibrationSamples;
}

/**
