|
123456789101112131415161718192021222324252627282930313233343536 |
-
- #include <SPI.h>
-
-
- #include <SdFat.h>
-
-
- const uint8_t SD_CS_PIN = SS;
-
- #ifdef __SD_H__
- File file;
- #else
- SdFat SD;
- SdFile file;
- #endif
-
- void setup() {
- Serial.begin(9600);
- while (!Serial) {}
-
- if (!SD.begin(SD_CS_PIN)) {
- Serial.println("begin failed");
- return;
- }
- #ifdef __SD_H__
- file = SD.open("SFN_file.txt", FILE_WRITE);
- #else
- file.open("LFN_file.txt", O_RDWR | O_CREAT);
- #endif
-
- file.println("Hello");
- file.close();
- Serial.println("Done");
- }
-
- void loop() {}
|