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.
Dependencies: mbed SDFileSystem
main.cpp
00001 // example writing to SD card, sford 00002 00003 #include "mbed.h" 00004 #include "SDFileSystem.h" 00005 00006 SDFileSystem sd(p5, p6, p7, p8, "sd"); // the pinout on the mbed Cool Components workshop board 00007 00008 int main() { 00009 printf("Hello World!\n"); 00010 00011 mkdir("/sd/mydir", 0777); 00012 00013 FILE *fp = fopen("/sd/mydir/sdtest.txt", "w"); 00014 if(fp == NULL) { 00015 error("Could not open file for write\n"); 00016 } 00017 fprintf(fp, "Hello fun SD Card World!"); 00018 fclose(fp); 00019 00020 printf("Goodbye World!\n"); 00021 }
Generated on Tue Jul 12 2022 13:07:47 by
1.7.2