Hello, I really like the new SD library, but there is the following issue:
#include <SD.h>
File myFile;
void setup() {
Serial.begin(9600);
Serial.print("Initializing SD card...");
pinMode(10, OUTPUT);
if (!SD.begin(4)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
}
void loop() {
if(SD.exists("testfile.txt")) Serial.println("Fiel Exists so SD seems to be in");
else Serial.println("Fiel does NOT exists or SD is not in socket");
delay(1000);
}
SD.exists() does return true or false, depending if the file could be found or not. But if you pull out the SD while the loop() is running, SD.exists() still returns TRUE.
Basically I like to use SD.exists() to check if a certain file is there to detect if my SD is in the socket or not because there is no other function within the SD library.
Is there any other way to make sure the SD is in the socket?
How ever, SD.exists() should not return TRUE if the file is not there for sure
