Tedd OKANO / Mbed 2 deprecated localfilesystem_and_serialusb

Dependencies:   mbed

main.cpp

Committer:
okano
Date:
2010-12-10
Revision:
0:dae07b2b659b

File content as of revision 0:dae07b2b659b:

//  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" );
}