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 2222
2323 */
2424
25- #include < SPI.h >
26- # include < SD.h >
25+ #include " SdFat.h "
26+ SdFat sd;
2727
28- #define SD_FAT_TYPE 3
28+ #define SD_FAT_TYPE 1
2929
3030// default CS pin is 23 for Metro RP2040
3131#define SD_CS_PIN 23
3232
33- File myFile;
33+ File32 myFile;
3434
3535void setup () {
3636 // Open serial communications and wait for port to open:
@@ -42,15 +42,15 @@ void setup() {
4242
4343 Serial.print (" Initializing SD card..." );
4444
45- if (!SD .begin (SD_CS_PIN)) {
45+ if (!sd .begin (SD_CS_PIN)) {
4646 Serial.println (" initialization failed!" );
4747 return ;
4848 }
4949 Serial.println (" initialization done." );
5050
5151 // open the file. note that only one file can be open at a time,
5252 // 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);
5454
5555 // if the file opened okay, write to it:
5656 if (myFile) {
@@ -66,7 +66,7 @@ void setup() {
6666 }
6767
6868 // re-open the file for reading:
69- myFile = SD .open (" test.txt" );
69+ myFile.open (" test.txt" );
7070 if (myFile) {
7171 Serial.println (" test.txt:" );
7272
You can’t perform that action at this time.
0 commit comments