   // 0 in position 1.
   else if (positions_white == 4)
   {
-    if (!photoresistor_history[i][0] && !photoresistor_history[i][3]
-        && !photoresistor_history[i][6])
+    if (!photoresistor_history[0] && !photoresistor_history[3]
+        && !photoresistor_history[6])
     {
       gear_types[i] = 0;
       gear_orientations[i] = 1;

    {
      // We have started calibrating!
      state = 1;
      last_selector_pos = -1; // state 1 case will fix
    }
  }


int pot_locs[14] = {1024, 885, 825, 690, 640, 450, 390, 280, 190, 70, 50, 24, 12, 0};

// above this = white; below = black (unlodged is undefined)
// TODO(benkraft): Recompute after we move them.
int photoresistor_thresholds[3] = {28, 6, 15};

// STATE OF THE WORLD
