udenokai sample

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 #include "TextLCD.h"
00004 TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7
00005 LocalFileSystem local("local");
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         lcd.cls();
00014         lcd.printf("open error");
00015     }
00016     char str[MAX_LEN];
00017     fgets( str , MAX_LEN-1 , fp );
00018     
00019     lcd.cls();
00020     lcd.printf(str);
00021     
00022     fclose(fp);
00023 }