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
00001 #include "mbed.h" 00002 #include "ff.h" 00003 00004 DigitalOut myled(LED1); 00005 Serial pc(USBTX, USBRX); 00006 00007 FATFS MyFileSystem; 00008 FIL MyFile; 00009 00010 int main() 00011 { 00012 unsigned int BytesWritten; 00013 00014 //mount the SD card (any drive number will map to the SD card) 00015 f_mount(0,&MyFileSystem); 00016 //Open the file for open and write 00017 f_open(&MyFile,"Test1.2.3.4.txt",FA_WRITE|FA_OPEN_ALWAYS); 00018 //Write some junk 00019 f_write(&MyFile,"Testing!\r\nTesting,1,2,3\r\n",27,&BytesWritten); 00020 //Close the file 00021 f_close(&MyFile); 00022 00023 while(1) 00024 { 00025 pc.printf("all done!!\r\n"); 00026 wait(1); 00027 myled = !myled; 00028 } 00029 }
Generated on Tue Jul 12 2022 19:25:49 by
1.7.2