Checking SD
Dependencies: mbed SDFileSystem
Revision 2:cc13d5354037, committed 2020-12-29
- Comitter:
- umezawa
- Date:
- Tue Dec 29 04:57:32 2020 +0000
- Parent:
- 1:e4d7342be507
- Commit message:
- test;
Changed in this revision
SDFileSystem.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e4d7342be507 -r cc13d5354037 SDFileSystem.lib --- a/SDFileSystem.lib Tue May 16 05:18:55 2017 +0000 +++ b/SDFileSystem.lib Tue Dec 29 04:57:32 2020 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/SDFileSystem/#8db0d3b02cec +https://os.mbed.com/users/umezawa/code/SDFileSystem/#0524f79c18f3
diff -r e4d7342be507 -r cc13d5354037 main.cpp --- a/main.cpp Tue May 16 05:18:55 2017 +0000 +++ b/main.cpp Tue Dec 29 04:57:32 2020 +0000 @@ -1,19 +1,21 @@ #include "mbed.h" #include "SDFileSystem.h" - -SDFileSystem sd(p5, p6, p7, p8, "sd"); // the pinout on the mbed Cool Components workshop board - -int main() { - printf("Hello World!\n"); - + +Serial pc(USBTX, USBRX); +SDFileSystem sd(D11, D12, D13, D9, "sd"); + +int main() +{ + pc.printf("Hello World!\n"); + mkdir("/sd/mydir", 0777); - + FILE *fp = fopen("/sd/mydir/sdtest.txt", "w"); if(fp == NULL) { error("Could not open file for write\n"); } fprintf(fp, "Hello fun SD Card World!"); - fclose(fp); - - printf("Goodbye World!\n"); + fclose(fp); + + pc.printf("Goodbye World!\n"); }