White Wizard micro SD Card module test program.You can use White Wizard SPI system easily! Details : http://wizard.nestegg.jp/sd.html
Diff: main.cpp
- Revision:
- 0:b8ab9a03a28d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jul 06 16:22:44 2011 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "SDFileSystem.h" + +SDFileSystem sd(p5, p6, p7, p8, "sd"); + +int main() { + + //channel No must be A4 A3 A2 A1 + sd.SetCh(0x05); //channel No 0101(=0x05), depend on your SPI module setting. (1:High 0:Low) + + 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"); +}