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 #include "mbed.h" 00002 #include "SDFileSystem.h" 00003 00004 //SDFileSystem sd(p5, p6, p7, p8, "sd"); // mosi, miso, sclk, cs 00005 SDFileSystem sd(PB_5, PB_4, PB_3, PA_10, "sd"); // mosi, miso, sclk, cs 00006 00007 int main() { 00008 printf("SD Card Testbed\n"); 00009 00010 //Perform a write test 00011 printf("Writing to SD card... "); 00012 FILE *fp = fopen("/sd/sdtest.txt", "w"); 00013 if (fp != NULL) { 00014 fprintf(fp, "We're writing to an SD card!"); 00015 fclose(fp); 00016 printf("success!\n"); 00017 } else 00018 printf("failed!\n"); 00019 fprintf(fp, "Hello fun SD Card World!"); 00020 fclose(fp); 00021 00022 printf("Goodbye World!\n"); 00023 }
Generated on Fri Jul 15 2022 09:06:31 by
1.7.2