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.
Diff: main.cpp
- Revision:
- 0:dae07b2b659b
--- /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" ); +}