new SdFat library beta - sensing card detect and write protect

The write protect tab is not electrically connected to the card. It can be sensed by most SD sockets and can be used to implement write protect in software. In practice it is not very useful with the Arduino since most apps write to files.

You could connect the socket write protect sensor to a digital pin and refuse to open files for write. It is probably better to sense write protect in your application and warn the user.

There is no standard way to detect write protect on SD shields so I did not implement it.

Card detect is not very useful either. Users expect to use it to implement card removal or card change.

You can't just remove a card since all files open for write must be closed or you will lose data or cause file system corruption. This means the user must signal the application to prepare for card removal. The application must the tell the user to change cards. At this point you could use card detect.

Sometimes the app tell the user when it wants to change the card. In any case most of the programming must be done in the app so card detect is best handled by the app.