Text LCD demo

Dependencies:   TextLCD mbed

main.cpp

Committer:
4180_1
Date:
2011-07-08
Revision:
0:bba654cca6d6

File content as of revision 0:bba654cca6d6:

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

TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, e, d0-d3
Timer t;

int main() {
// Start timer
    t.start();
// Clear LCD Screen
    lcd.cls();
    wait(1);
// Print to LCD on first line
    lcd.printf("Hello LCD World!\n");
    while (1) {
// Move cursor to start of second display line
        lcd.locate(0,1);
// Print elapsed time from timer on LCD
        lcd.printf("%e sec", t.read());
        wait(.2);
    }
}