   delay(1); // allow a very short delay for display response
   setDisplayValues(pelletCount);
   
-  pinMode(PIPin, INPUT);
-  pinMode(TTL, OUTPUT);
+  pinMode(PHOTO_INTERRUPTER_PIN, INPUT);
+  pinMode(TTL_DEBUG_PIN, OUTPUT);
   pinMode(CS_pin, OUTPUT);
   pinMode(SS, OUTPUT);
 
   Wire.begin();
+  
+  // both the stepper control and RTC use I2C (the Wire library)
   RTC.begin(); // RTC library needs Wire
+
+  // set up stepper
+  gMotorShield.begin(); // use default I2C address of 0x40
+  gPtrToStepper->setSpeed(30); // rpm, max suggested by Adafruit for this 5V stepper
 
   if (! RTC.isrunning()) {
     Serial.println(F("RTC is NOT running!"));

    pelletCount ++;
    Serial.println(F("It did work"));
    clearDisplay();
    delay(1); // allow a very short delay for display response
    setDisplayValues(pelletCount);
    lastState = PIState;

  }
  else if (PIState == 1) {
    Serial.println(F("Turning motor..."));
    motor.step(-steps / 2);
    motor.step(steps);
    lastState = PIState;
  }
  

    dataFile.println(F("Time,Pellet Count,Pellet Drop Delay"));
    dataFile.close();
  }
    
  delay (500);
  
  // get ready for what the system should be doing
  PIState = digitalRead(PHOTO_INTERRUPTER_PIN);
  lastState = 0;
}

void loop()
{
  PIState = digitalRead(PHOTO_INTERRUPTER_PIN);
  Serial.print("Photointerrupter State: ");
  Serial.println(PIState);
  digitalWrite(TTL_DEBUG_PIN, LOW);

  if (PIState == 1  & PIState != lastState) {    
    digitalWrite(TTL_DEBUG_PIN, HIGH);    
    startTime = millis();
    Serial.print(F("Time Elapsed Check: "));
    Serial.println(timeElapsed);
