Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SD.open(...) Timeout How can I set it? #7494

Unanswered
TiagoARAlves asked this question in Q&A
Discussion options

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.

You must be logged in to vote

Replies: 1 comment

Comment options

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.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /