![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Dependencies: FATFileSystem2 SDFileSystem mbed
Revision 0:7f3dfc9ab361, committed 2013-05-24
- Comitter:
- robt
- Date:
- Fri May 24 22:16:51 2013 +0000
- Commit message:
- by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Changed in this revision
diff -r 000000000000 -r 7f3dfc9ab361 FATFileSystem.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FATFileSystem.lib Fri May 24 22:16:51 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/robt/code/FATFileSystem2/#e347ded9bd26
diff -r 000000000000 -r 7f3dfc9ab361 SDFileSystem.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SDFileSystem.lib Fri May 24 22:16:51 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/robt/code/SDFileSystem/#797837e09acb
diff -r 000000000000 -r 7f3dfc9ab361 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri May 24 22:16:51 2013 +0000 @@ -0,0 +1,21 @@ +/* Program Example 10.4: writing data to an SD card + */ + +#include "mbed.h" +#include "SDFileSystem.h" + +SDFileSystem sd(p11, p12, p13, p14, "sd"); // MOSI, MISO, SCLK, CS +Serial pc(USBTX, USBRX); + +int main() { + + FILE *File = fopen("/sd/sdfile.txt", "w"); // open file + if(File == NULL) { // check for file pointer + pc.printf("Could not open file for write\n"); + }else{ + pc.printf("SD card file succesfully opened\n"); + } + fprintf(File, "Here's some sample text on the SD card"); // write data + fclose(File); // close file + +}
diff -r 000000000000 -r 7f3dfc9ab361 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri May 24 22:16:51 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e \ No newline at end of file