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
Diff: main.cpp
- Revision:
- 0:aee5cf626b88
- Child:
- 1:27aaaa9f462b
--- /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"); +}