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 USBFileSystem
Fork of USBFileSystem_RAMDISK_HelloWorld by
Diff: main.cpp
- Revision:
- 1:e1b0157ce547
- Parent:
- 0:fc0ff7c1656b
- Child:
- 2:1c8a3c4ba703
--- a/main.cpp Wed May 15 22:39:46 2013 +0000
+++ b/main.cpp Tue Jul 30 18:27:18 2013 +0000
@@ -2,7 +2,20 @@
#include "USBMSD_Ram.h"
USBMSD_Ram sd;
+DigitalOut led(LED_GREEN);
+Serial pc(USBTX, USBRX);
int main() {
- while(1);
+ pc.baud(115200);
+ while(1) {
+ led = 1;
+ printf("Connecting!\n");
+ if (!sd.connect())
+ error("Failed to connect!\n");
+ wait(5);
+ led = 0;
+ printf("Disconnecting!\n");
+ sd.disconnect();
+ wait(2);
+ }
}
\ No newline at end of file
