testing TextLCD and SD card

Dependencies:   mbed

main.cpp

Committer:
funax
Date:
2010-07-01
Revision:
1:60d8589343b6
Parent:
0:cc883de36463

File content as of revision 1:60d8589343b6:

#include "mbed.h"
#include "TextLCD.h"
#include "SDFileSystem.h"

TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); // rs, rw, e, d0, d1, d2, d3
SDFileSystem sd(p5, p6, p7, p13, "sd");

int main() {
    lcd.printf("Hello World!!");
    lcd.locate(0, 1);

    FILE *fp = fopen("/sd/foo.txt", "w");
    if(fp == NULL) {
        error("Could not open file for write\n");
    }
    fprintf(fp, "Hello SD Card World!!");
    fclose(fp); 

    lcd.printf("Sayonara World!!");
}