Dependencies: SDFileSystem mbed
Revision 0:3cd4416d0506, committed 2015-11-25
- Comitter:
- chetanpatil
- Date:
- Wed Nov 25 12:02:52 2015 +0000
- Commit message:
- sd
Changed in this revision
diff -r 000000000000 -r 3cd4416d0506 SDFileSystem.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SDFileSystem.lib Wed Nov 25 12:02:52 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/neilt6/code/SDFileSystem/#2286a4e7fa31
diff -r 000000000000 -r 3cd4416d0506 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Nov 25 12:02:52 2015 +0000 @@ -0,0 +1,47 @@ +#include "mbed.h" +#include "SDFileSystem.h" + Serial pc(USBTX, USBRX); +//Create an SDFileSystem object +SDFileSystem sd(p5, p6, p7, p8, "sd"); + +int main() +{ + + char buff[255]; + FILE *fp = fopen("/sd/sdtest.txt", "w"); + + if(fp == NULL) { + + error("Could not open file for write\n"); + + } + else + { + printf("successful\n"); + + fprintf(fp,"Sagar file found", buff ); + } + + + + fclose(fp); + FILE *fp1 = fopen("/sd/sdtest.txt", "r"); + + if(fp1 == NULL) { + + error("Could not open file for write\n"); + + } + else if(fp == fp1) + { + printf("File is same\n"); + fscanf(fp, "%s", buff); + printf("%s",buff); + } + + + + fclose(fp1); + + +}
diff -r 000000000000 -r 3cd4416d0506 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Nov 25 12:02:52 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file