Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

36 rindas
821B

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