Just a sample to show the USB serial communication can be done while the mbed volume mounted

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
okano
Date:
Fri Dec 10 02:34:08 2010 +0000
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 10 02:34:08 2010 +0000
@@ -0,0 +1,24 @@
+//  Just a sample to show the USB serial communication can be done while the mbed volume mounted
+
+#include "mbed.h"
+
+LocalFileSystem local("local");
+
+int main() {
+
+    FILE    *fp;
+    printf( "TEST started\r\n" );
+
+    if ( NULL == (fp    = fopen( "/local/test.txt", "w" )) )
+        error( "couldn't open file to read...(2)" );
+
+    for ( int i = 0; i < 10; i++ ) {
+        printf( "%d\r\n", i );
+        wait( 1 );
+    }
+
+    fprintf( fp, "hello file world\n" );
+    fclose( fp );
+
+    printf( "TEST completed\r\n" );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Dec 10 02:34:08 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e