I think the main reason is that SD.h is the standard SD library included with the IDE.
So these are two reasons:
- backwards compatibility of old sketches
- they do not know other sd libs
The SdFat API has many more functions than SD.h so it is harder to understand. Most people use the most basic functionality and don't require much performance so SD.h is fine.
For basic sketches SdFat is smaller and the complexity is about the same as SD.h.
Here is a simple SdFat sketch that writes a line to a file. It uses 10,736 bytes of flash with the latest version of SdFat and Arduino 1.0.5.
/*
* Sketch to compare size of SdFat with Arduino SD library.
* See SD_Size.ino for Arduino SD sketch.
*
*/
#include <SdFat.h>
SdFat sd;
SdFile file;
//------------------------------------------------------------------------------
void setup() {
Serial.begin(9600);
while (!Serial) {} // wait for Leonardo
if (!sd.begin()) {
Serial.println("begin failed");
return;
}
file.open("SIZE_TST.TXT", O_RDWR | O_CREAT | O_AT_END);
file.println("Hello");
file.close();
Serial.println("Done");
}
//------------------------------------------------------------------------------
void loop() {}
Here is the SD.h version of the sketch. It uses 13,278 bytes of flash with Arduino 1.0.5.
/*
* Sketch to compare size of Arduino SD library with SdFat.
* See SdFatSize.ino for SdFat sketch.
*/
#include <SPI.h>
#include <SD.h>
File file;
//------------------------------------------------------------------------------
void setup() {
Serial.begin(9600);
while (!Serial) {} // wait for Leonardo
if (!SD.begin()) {
Serial.println("begin failed");
return;
}
file = SD.open("TEST_SD.TXT", FILE_WRITE);
file.println("Hello");
file.close();
Serial.println("Done");
}
//------------------------------------------------------------------------------
void loop() {}