![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
mX mbed BaseBoard SD card
main.cpp@0:c44f7e0926c7, 2010-12-08 (annotated)
- Committer:
- ashwin_athani
- Date:
- Wed Dec 08 06:27:28 2010 +0000
- Revision:
- 0:c44f7e0926c7
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashwin_athani | 0:c44f7e0926c7 | 1 | #include "mbed.h" |
ashwin_athani | 0:c44f7e0926c7 | 2 | #include "SDFileSystem.h" |
ashwin_athani | 0:c44f7e0926c7 | 3 | |
ashwin_athani | 0:c44f7e0926c7 | 4 | SDFileSystem sd(p5, p6, p7, p8, "sd"); // NGX mbed base board |
ashwin_athani | 0:c44f7e0926c7 | 5 | |
ashwin_athani | 0:c44f7e0926c7 | 6 | int main() { |
ashwin_athani | 0:c44f7e0926c7 | 7 | printf("Hello World!\n"); |
ashwin_athani | 0:c44f7e0926c7 | 8 | |
ashwin_athani | 0:c44f7e0926c7 | 9 | FILE *fp = fopen("/sd/sdtest.txt", "w"); |
ashwin_athani | 0:c44f7e0926c7 | 10 | if(fp == NULL) { |
ashwin_athani | 0:c44f7e0926c7 | 11 | error("Could not open file for write\n"); |
ashwin_athani | 0:c44f7e0926c7 | 12 | } |
ashwin_athani | 0:c44f7e0926c7 | 13 | fprintf(fp, "Hello fun SD Card World!"); |
ashwin_athani | 0:c44f7e0926c7 | 14 | fclose(fp); |
ashwin_athani | 0:c44f7e0926c7 | 15 | |
ashwin_athani | 0:c44f7e0926c7 | 16 | printf("Goodbye World!\n"); |
ashwin_athani | 0:c44f7e0926c7 | 17 | } |