file
Dependencies: SDFileSystem mbed
Fork of SDFileSystem_HelloWorld by
Revision 1:55b4dc63f976, committed 2015-11-25
- Comitter:
- nehap
- Date:
- Wed Nov 25 09:34:46 2015 +0000
- Parent:
- 0:bdbd3d6fc5d5
- Commit message:
- file;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Dec 07 11:25:01 2012 +0000 +++ b/main.cpp Wed Nov 25 09:34:46 2015 +0000 @@ -1,19 +1,21 @@ #include "mbed.h" #include "SDFileSystem.h" - + Serial pc(USBTX, USBRX); SDFileSystem sd(p5, p6, p7, p8, "sd"); // the pinout on the mbed Cool Components workshop board -int main() { - printf("Hello World!\n"); +int main() +{ + printf("Welcome to sd card interface\n"); mkdir("/sd/mydir", 0777); - FILE *fp = fopen("/sd/mydir/sdtest.txt", "w"); - if(fp == NULL) { - error("Could not open file for write\n"); + FILE *fp = fopen("/sd/mydir/Heo world.docx", "r"); + if(fp == NULL) + { + error("not able to open for read operation\n"); } - fprintf(fp, "Hello fun SD Card World!"); + fprintf(fp,"Hello fun SD Card World\n"); fclose(fp); - printf("Goodbye World!\n"); + printf("found\n"); }