You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 line
804B

  1. // Program to compare size of SdFat with the SD.h library.
  2. // Select the test library by commenting out one of the following two lines.
  3. // #include <SD.h>
  4. #include <SdFat.h>
  5. // SD chip select pin.
  6. const uint8_t SD_CS_PIN = SS;
  7. #ifdef __SD_H__
  8. File file;
  9. #else // __SD_H__
  10. SdFat SD;
  11. SdFile file;
  12. #endif // __SD_H__
  13. void setup() {
  14. Serial.begin(9600);
  15. while (!Serial) {} // wait for Leonardo
  16. if (!SD.begin(SD_CS_PIN)) {
  17. Serial.println("begin failed");
  18. return;
  19. }
  20. #ifdef __SD_H__
  21. file = SD.open("SFN_file.txt", FILE_WRITE);
  22. #else // __SD_H__
  23. file.open("LFN_file.txt", O_RDWR | O_CREAT);
  24. #endif // __SD_H__
  25. file.println("Hello");
  26. file.close();
  27. Serial.println("Done");
  28. }
  29. //------------------------------------------------------------------------------
  30. void loop() {}