SD_Size.ino 620 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Program to compare size of Arduino SD library with SdFat.
  3. * See SdFatSize.ino for SdFat program.
  4. */
  5. #include <SPI.h>
  6. #include <SD.h>
  7. File file;
  8. //------------------------------------------------------------------------------
  9. void setup() {
  10. Serial.begin(9600);
  11. // Wait for USB Serial
  12. while (!Serial) {
  13. yield();
  14. }
  15. if (!SD.begin()) {
  16. Serial.println("begin failed");
  17. return;
  18. }
  19. file = SD.open("TEST_SD.TXT", FILE_WRITE);
  20. file.println("Hello");
  21. file.close();
  22. Serial.println("Done");
  23. }
  24. //------------------------------------------------------------------------------
  25. void loop() {}