Testbed for ExtTextLCD

Dependencies:   mbed

Committer:
osmeest
Date:
Sat Feb 05 23:19:52 2011 +0000
Revision:
0:0a32d52ad7db

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
osmeest 0:0a32d52ad7db 1 // Hello World! for the TextLCD
osmeest 0:0a32d52ad7db 2
osmeest 0:0a32d52ad7db 3 #include "ext_text_lcd/TextLCD.h"
osmeest 0:0a32d52ad7db 4 #include <sstream>
osmeest 0:0a32d52ad7db 5 #include <iostream>
osmeest 0:0a32d52ad7db 6 #include <iomanip>
osmeest 0:0a32d52ad7db 7
osmeest 0:0a32d52ad7db 8 using namespace std;
osmeest 0:0a32d52ad7db 9 using namespace ext_text_lcd;
osmeest 0:0a32d52ad7db 10
osmeest 0:0a32d52ad7db 11 //TextLCD lcd(p28, p27, p26, p25, p24, p23, TextLCD::LCD20x2); // rs, e, d4-d7
osmeest 0:0a32d52ad7db 12 TextLCD lcd(p28, p27, Port2, 0, TextLCD::LCD20x2); // rs, e, d4-d7
osmeest 0:0a32d52ad7db 13
osmeest 0:0a32d52ad7db 14 int main() {
osmeest 0:0a32d52ad7db 15 lcd.setDisplayControl(TextLCD::DisplayOn, TextLCD::CursorOn, TextLCD::BlinkingCursor);
osmeest 0:0a32d52ad7db 16
osmeest 0:0a32d52ad7db 17 lcd.locate(0,0);
osmeest 0:0a32d52ad7db 18 lcd.printf("(0,0)");
osmeest 0:0a32d52ad7db 19 lcd.locate(0,1);
osmeest 0:0a32d52ad7db 20 lcd.printf("(0,1)");
osmeest 0:0a32d52ad7db 21 lcd.locate(14,0);
osmeest 0:0a32d52ad7db 22 lcd.printf("(19,0)");
osmeest 0:0a32d52ad7db 23 lcd.locate(14,1);
osmeest 0:0a32d52ad7db 24 lcd.printf("(19,1)");
osmeest 0:0a32d52ad7db 25
osmeest 0:0a32d52ad7db 26 while (1) {
osmeest 0:0a32d52ad7db 27 lcd.locate(0,0);
osmeest 0:0a32d52ad7db 28 wait(2);
osmeest 0:0a32d52ad7db 29 lcd.locate(0,1);
osmeest 0:0a32d52ad7db 30 wait(2);
osmeest 0:0a32d52ad7db 31 lcd.locate(19,0);
osmeest 0:0a32d52ad7db 32 wait(2);
osmeest 0:0a32d52ad7db 33 lcd.locate(19,1);
osmeest 0:0a32d52ad7db 34 wait(2);
osmeest 0:0a32d52ad7db 35 }
osmeest 0:0a32d52ad7db 36 }