SD USB MSD helloworld
Dependencies: USBFileSystem USBSDFileSystem mbed
Created based on comment from Erik Olieman see https://mbed.org/questions/1181/combine-SDfilesystem-with-USBMSD_SD/?c=7180
As well as based on SDFileSystem library for the spi-access to SD-card.
It gives the next output:
Hello World! now a USB drive should appear on your PC create directory and append to log file appending: '[0]Hello fun SD Card World!' Entering loop of 1 min cycle time appending: '[1]Hello fun SD Card World!' appending: '[2]Hello fun SD Card World!' ...
This works.
Although, I've to admit it is not very convenient, since my win7 pc always disconnect/connect the drive and at disconnect it also closes the explorer which show the content of that drive. It does the same with the editor that has the file opened.
Revision 2:f7b4edf066de, committed 2013-08-28
- Comitter:
- karelv
- Date:
- Wed Aug 28 19:32:16 2013 +0000
- Parent:
- 1:c7f66434c692
- Commit message:
- cosmetic changes
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Aug 27 19:42:29 2013 +0000 +++ b/main.cpp Wed Aug 28 19:32:16 2013 +0000 @@ -19,8 +19,9 @@ } } -int main() { +int main() +{ sd.usbMode (1); // allow fopen/fprintf when connected with USB-drive. printf("Hello World!\n\n"); @@ -43,4 +44,5 @@ myled = 1; wait(55); } + return 0; }