taichi yanagisawa / Mbed 2 deprecated LocalFileSystem_Load

Dependencies:   TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 //udenokai sample
00002 #include "mbed.h"
00003 
00004 LocalFileSystem local("local");
00005 Serial pc(USBTX, USBRX); // tx, rx
00006 
00007 const unsigned int MAX_LEN = 256;
00008 
00009 int main()
00010 {
00011     FILE *fp = fopen("/local/test.txt","r");
00012     if(NULL == fp){
00013         pc.printf("open error");
00014     }
00015     char str[MAX_LEN];
00016     
00017     fgets( str , MAX_LEN-1 , fp );
00018     pc.printf(str);
00019     
00020     fclose(fp);
00021 }