 // ================ SYSTEM PARAMETERS ===================
 // Sample rates
 const int motorUpdateRate = 50; // gyro sample rate
-const int calibrationSamples = 250;
+const int calibrationSamples = 1000;
 
 // Initial calibration value
-float calibratedOffset = 0;
+float calibratedOffset;
 
 // Indicator LED
 const int LED = 13;

  // Update orientation data with measurements from gyro
  // Just using angular rates from gyro and time deltas to track position using a Reimann sum.
  int currentTime = millis();
  int deltaT = currentTime - timer;
  positionChange += deltaT * readGyro() / 1000; // Gyro data is given in 1000ths of a degree, so we divide by 1000
  timer = currentTime;

  // Update motor position

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

// Interrupt flag
int timer = millis();
bool update_flag = false; // interrupt flag for executing motor update
int ref;
/**
    Sets up system
*/
