udenokai sample

Dependencies:   TextLCD mbed

Committer:
marishi
Date:
Fri Jun 10 17:52:47 2011 +0000
Revision:
0:7647fa87431f

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
marishi 0:7647fa87431f 1 //udenokai sample
marishi 0:7647fa87431f 2 #include "mbed.h"
marishi 0:7647fa87431f 3 #include "TextLCD.h"
marishi 0:7647fa87431f 4 TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7
marishi 0:7647fa87431f 5 LocalFileSystem local("local");
marishi 0:7647fa87431f 6
marishi 0:7647fa87431f 7 const unsigned int MAX_LEN = 256;
marishi 0:7647fa87431f 8
marishi 0:7647fa87431f 9 int main()
marishi 0:7647fa87431f 10 {
marishi 0:7647fa87431f 11 FILE *fp = fopen("/local/test.txt","r");
marishi 0:7647fa87431f 12 if(NULL == fp){
marishi 0:7647fa87431f 13 lcd.cls();
marishi 0:7647fa87431f 14 lcd.printf("open error");
marishi 0:7647fa87431f 15 }
marishi 0:7647fa87431f 16 char str[MAX_LEN];
marishi 0:7647fa87431f 17 fgets( str , MAX_LEN-1 , fp );
marishi 0:7647fa87431f 18
marishi 0:7647fa87431f 19 lcd.cls();
marishi 0:7647fa87431f 20 lcd.printf(str);
marishi 0:7647fa87431f 21
marishi 0:7647fa87431f 22 fclose(fp);
marishi 0:7647fa87431f 23 }