jim hamblen / Mbed 2 deprecated HelloLCD

Dependencies:   TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TextLCD.h"
00003 
00004 TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, e, d0-d3
00005 Timer t;
00006 
00007 int main() {
00008 // Start timer
00009     t.start();
00010 // Clear LCD Screen
00011     lcd.cls();
00012     wait(1);
00013 // Print to LCD on first line
00014     lcd.printf("Hello LCD World!\n");
00015     while (1) {
00016 // Move cursor to start of second display line
00017         lcd.locate(0,1);
00018 // Print elapsed time from timer on LCD
00019         lcd.printf("%e sec", t.read());
00020         wait(.2);
00021     }
00022 }