Olivier Smeesters / Mbed 2 deprecated ExtTextLCDTest

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // Hello World! for the TextLCD
00002 
00003 #include "ext_text_lcd/TextLCD.h"
00004 #include <sstream>
00005 #include <iostream>
00006 #include <iomanip>
00007 
00008 using namespace std;
00009 using namespace ext_text_lcd;
00010 
00011 //TextLCD lcd(p28, p27, p26, p25, p24, p23, TextLCD::LCD20x2); // rs, e, d4-d7
00012 TextLCD lcd(p28, p27, Port2, 0, TextLCD::LCD20x2); // rs, e, d4-d7
00013 
00014 int main() {
00015     lcd.setDisplayControl(TextLCD::DisplayOn, TextLCD::CursorOn, TextLCD::BlinkingCursor);
00016 
00017     lcd.locate(0,0);
00018     lcd.printf("(0,0)");
00019     lcd.locate(0,1);
00020     lcd.printf("(0,1)");
00021     lcd.locate(14,0);
00022     lcd.printf("(19,0)");
00023     lcd.locate(14,1);
00024     lcd.printf("(19,1)");
00025     
00026     while (1) {
00027         lcd.locate(0,0);
00028         wait(2);
00029         lcd.locate(0,1);
00030         wait(2);
00031         lcd.locate(19,0);
00032         wait(2);
00033         lcd.locate(19,1);
00034         wait(2);
00035     }
00036 }