-
Notifications
You must be signed in to change notification settings - Fork 7.7k
SD.open(...) Timeout How can I set it? #7494
Unanswered
TiagoARAlves
asked this question in
Q&A
-
When I open a file, SD.open(...), if there is no microsd it takes 1s before telling me it gave an error. How can I set a shorter timeout?
It would be for a hard runtime software that would have to continue even without the microsd running, and could not be subject to stop for 1s.
I hope you can help me,
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Hi,
You can try the following code to detect the presence of a SD card attached:
uint8_t cardType = SD.cardType();
if(cardType == CARD_NONE){
Serial.println("No SD card attached");
return;
}
Change it according to your needs.
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment