Which is the best and more accurate library to use with an Mega2560 board with EthernetShield (the last one with sdhc card slot) ?
Must I use SD.h library or SdFat.h ?
Thanks for your comments.
Grag
I want also use Ethernet libraries, so from the choice of using to good SD lib is important (switching from Ethernet to SD et go Back from SD to Ethernet).
There will be no real difference. SD is just a thin wrapper for SdFat to provide a different API. You don't even need to install SdFat to use its API. Here is an example that will print a line to a file.
The new version of SdFat, which is in beta, has improved SPI access and plays better than many other libraries that use SPI. It also has better error handling and C++ I/O operators. It is simpler to use and has most of the features of the SD.h wrapper.
Thanks for the fast answer from you. Another trouble.
When the sd is inserted into the Ethernet Shield, Server is not responding. If I remove the card, server works again. I d'ont use for the moment SD code in my app. What could be the trouble of this fact ?
It allows to set correctly the pins before using one or the other harware : Ethernet or SD. Ités a little tricky to program but it works. (I'm no yet sure if 'delay(10)' lines are important.
Another thing to test : Is it possible to let an file 'open' during et switch from sd to ethernet, doing some stuff and back to the sd to continue to write datas without opening again the file.
Bye, and thanks to this forum that got a so lot of informations !