     Serial.println("error opening for reading");
   }
 }
-
-int counter = 0;
 
 // Append int value to file
 void logToFile(char* filename, int value)

    Serial.println("T_out.txt: ");
    readFileToSerial("T_out.txt");
  }
  buttonPressed = false;

}

void setup()
{
  Serial.begin(9600);
  setSyncProvider(RTC.get); // get time from Real Time Clock
  if(timeStatus()!= timeSet)
    Serial.println("Unable to sync with the RTC");
  else
    Serial.println("RTC has set the system time");

  // Set button to write to file
  attachInterrupt(0, buttonInterrupt, RISING);

  // Set call to update files every minute
  Alarm.timerRepeat(10, recordData);
}

void loop()
{
  if (buttonPressed)
  {
    recordData();
  }

  Alarm.delay(1000); // Check every second
}



  return true;
}

boolean trigger_button = false;
void buttonInterrupt()
{
  trigger_button = true;
}

void updateTemperatures()
{
  tempA = thermistorA.getReading();
  tempB = thermistorB.getReading();
}

// Read and record data to log files
