 Adafruit_MotorShield gMotorShield = Adafruit_MotorShield();
 Adafruit_StepperMotor *gPtrToStepper = gMotorShield.getStepper(MOTOR_STEPS_PER_REVOLUTION,2);
 
+#define FILENAME "PelletData.csv"
+const int CS_pin = 10;
+SdFat SD;
+File dataFile;
+
 void setup() {
   //power saving stuff
   for (byte i=2; i <= 20; i++)

  updateDisplay();

  //SD card pin setup
  pinMode(10, OUTPUT); //CS pin
  pinMode(SS, OUTPUT);

  //motor shield stuff
  /*gMotorShield.begin();
  gPtrToStepper->setSpeed(30);//*/

  //SD card stuff
  /*Wire.begin();
  RTC.begin();

  if (! RTC.isrunning()) {
    Serial.println(F("RTC is NOT running!"));
    RTC.adjust(DateTime(F(__DATE__), F(__TIME__)));
  }//*/ 

  delay(500);

  //setup photointerrupter vals
  for (int i = 0; i < 2; i++)
  { PIStates[i] = digitalRead(PHOTO_INTERRUPTER_PINS[i]); lastStates[i] = PIStates[i]; }
}

void loop() {

    Serial.print(String(inputNum + 1));
    Serial.print(F(" taken: "));
    Serial.println(String(pelletCount[inputNum]));

    logData();
    updateDisplay();
  }
  else if (PIStates[inputNum] == 1) {
