Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- halfpitch
- Date:
- 2011-07-06
- Revision:
- 0:b8ab9a03a28d
File content as of revision 0:b8ab9a03a28d:
#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");
}