     Y_calibration += event.magnetic.y;
     delay(10);
   }
+  // Calculates a correction for the gyroscope
   double cur = 0;
   for (int i = 0; i < 10; i++)
   {

  elapsedMillis mils;
  sensors_event_t event;
  float total = 0;
  double cur = 0;
  for (int i = 0; i < 10; i++)
  {

bool timeUp = false;
// Corrects drift in the gyroscope
double gyroCorrect = 0.015;
// Prevents the automatic speed correction from slowing down too much
uint8_t rightForwardSpeed_max = rightForwardSpeed;
uint8_t rightBackwardSpeed_min = rightBackwardSpeed;

