   const unsigned short trials = 20;
   for (int trial = 0; trial < trials; trial++) {
     sensors_vec_t sensorData = getOrientation();
-    sensorError[0] += (float)sensorData.pitch;
-    sensorError[1] += (float)sensorData.roll;
+    sensorError.pitch += (float)sensorData.pitch;
+    sensorError.roll += (float)sensorData.roll;
     delay(20);
   }
-  sensorError[0] /= trials;
-  sensorError[1] /= trials;
+  sensorError.pitch /= trials;
+  sensorError.roll /= trials;
   calibrating = false;
   
   digitalWrite(armLED, HIGH);

  orientation.roll = -orientation.pitch;
  orientation.pitch = roll;
  if (!calibrating) {
    orientation.pitch -= sensorError[0];
    orientation.roll -= sensorError[1];
  }
  orientation.heading = -orientation.heading;
  return orientation;

const int readyLED = A0;
const int armButton = 2;
boolean armed = false;

struct SensorError {
  float pitch;
  float roll;
};
SensorError sensorError = {0, 0};
boolean calibrating = true;

Adafruit_10DOF                dof   = Adafruit_10DOF();
