File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Adafruit_Metro_RP2040/Arduino/Metro_RP2040_SD_Card_Test Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 22
22
23
23
*/
24
24
25
- #include < SPI.h >
26
- # include < SD.h >
25
+ #include " SdFat.h "
26
+ SdFat sd;
27
27
28
- #define SD_FAT_TYPE 3
28
+ #define SD_FAT_TYPE 1
29
29
30
30
// default CS pin is 23 for Metro RP2040
31
31
#define SD_CS_PIN 23
32
32
33
- File myFile;
33
+ File32 myFile;
34
34
35
35
void setup () {
36
36
// Open serial communications and wait for port to open:
@@ -42,15 +42,15 @@ void setup() {
42
42
43
43
Serial.print (" Initializing SD card..." );
44
44
45
- if (!SD .begin (SD_CS_PIN)) {
45
+ if (!sd .begin (SD_CS_PIN)) {
46
46
Serial.println (" initialization failed!" );
47
47
return ;
48
48
}
49
49
Serial.println (" initialization done." );
50
50
51
51
// open the file. note that only one file can be open at a time,
52
52
// so you have to close this one before opening another.
53
- myFile = SD .open (" test.txt" , FILE_WRITE);
53
+ myFile.open (" test.txt" , FILE_WRITE);
54
54
55
55
// if the file opened okay, write to it:
56
56
if (myFile) {
@@ -66,7 +66,7 @@ void setup() {
66
66
}
67
67
68
68
// re-open the file for reading:
69
- myFile = SD .open (" test.txt" );
69
+ myFile.open (" test.txt" );
70
70
if (myFile) {
71
71
Serial.println (" test.txt:" );
72
72
You can’t perform that action at this time.
0 commit comments