testing TextLCD and SD card

Dependencies:   mbed

Committer:
funax
Date:
Thu Jul 01 18:04:37 2010 +0000
Revision:
1:60d8589343b6
Parent:
0:cc883de36463

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
funax 0:cc883de36463 1 #include "mbed.h"
funax 0:cc883de36463 2 #include "TextLCD.h"
funax 1:60d8589343b6 3 #include "SDFileSystem.h"
funax 0:cc883de36463 4
funax 0:cc883de36463 5 TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); // rs, rw, e, d0, d1, d2, d3
funax 0:cc883de36463 6 SDFileSystem sd(p5, p6, p7, p13, "sd");
funax 0:cc883de36463 7
funax 0:cc883de36463 8 int main() {
funax 0:cc883de36463 9 lcd.printf("Hello World!!");
funax 0:cc883de36463 10 lcd.locate(0, 1);
funax 0:cc883de36463 11
funax 0:cc883de36463 12 FILE *fp = fopen("/sd/foo.txt", "w");
funax 0:cc883de36463 13 if(fp == NULL) {
funax 0:cc883de36463 14 error("Could not open file for write\n");
funax 0:cc883de36463 15 }
funax 0:cc883de36463 16 fprintf(fp, "Hello SD Card World!!");
funax 0:cc883de36463 17 fclose(fp);
funax 0:cc883de36463 18
funax 0:cc883de36463 19 lcd.printf("Sayonara World!!");
funax 0:cc883de36463 20 }