I recently finished an rfid door access system for my house and everything works as intended. The only issue I am having is after about a day of running the system, it will act is if the sd card has been removed or as if it can no longer access the card.

if (!SD.begin(10)) { Serial.println("initialization failed!"); return; } Serial.println("initialization done."); // open the file. note that only one file can be open at a time, // so you have to close this one before opening another. for (int i =0 ;; i++) { myFile = SD.open("test.txt", FILE_WRITE); if (!myFile) { Serial.println(i); while(1); } }