An example using the SDFileSystem library to create a directory and write a fiel to an SD card, using its SPI interface
Dependencies: mbed SDFileSystem
Revision 0:aee5cf626b88, committed 2010-06-03
- Comitter:
- simon
- Date:
- Thu Jun 03 16:35:25 2010 +0000
- Child:
- 1:27aaaa9f462b
- Commit message:
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FATFileSystem.lib Thu Jun 03 16:35:25 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_unsupported/code/fatfilesystem/ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SDFileSystem.lib Thu Jun 03 16:35:25 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/SDFileSystem/#b1ddfc9a9b25
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jun 03 16:35:25 2010 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" +#include "SDFileSystem.h" + +SDFileSystem sd(p11, p12, p13, p27, "sd"); + +int main() { + printf("Hello World!\n"); + + FILE *fp = fopen("/sd/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"); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jun 03 16:35:25 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/029aa53d7323