Demo of using an SD Card (FAT Filing Systems)
Dependencies: ELEC350-Practicals-FZ429
Fork of SD_Card_OS by
Diff: main.cpp
- Revision:
- 3:22f260c7e6cf
- Parent:
- 2:fad34c30dcc4
- Child:
- 4:61f070bd5915
--- a/main.cpp Wed Nov 22 15:18:28 2017 +0000
+++ b/main.cpp Wed Nov 22 16:05:26 2017 +0000
@@ -53,11 +53,12 @@
errorCode(FATAL);
}
- //Read in three strings
- char s1[64], s2[64], s3[64];
- fscanf(fp, "%s %s %s", s1,s2,s3);
+ //Read back all strings
+ char s1[64];
+ while (fscanf(fp, "%s", s1) == 1) {
+ printf("READ BACK: %s\n", s1);
+ }
//To read a whole line, use: fgets(s1, sizeof(s1), fp);
- printf("READ BACK: %s %s %s\n", s1, s2, s3);
//Close File
fclose(fp);
