Olivier Smeesters
/
ExtTextLCDTest
Testbed for ExtTextLCD
Diff: main.cpp
- Revision:
- 0:0a32d52ad7db
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Feb 05 23:19:52 2011 +0000 @@ -0,0 +1,36 @@ +// Hello World! for the TextLCD + +#include "ext_text_lcd/TextLCD.h" +#include <sstream> +#include <iostream> +#include <iomanip> + +using namespace std; +using namespace ext_text_lcd; + +//TextLCD lcd(p28, p27, p26, p25, p24, p23, TextLCD::LCD20x2); // rs, e, d4-d7 +TextLCD lcd(p28, p27, Port2, 0, TextLCD::LCD20x2); // rs, e, d4-d7 + +int main() { + lcd.setDisplayControl(TextLCD::DisplayOn, TextLCD::CursorOn, TextLCD::BlinkingCursor); + + lcd.locate(0,0); + lcd.printf("(0,0)"); + lcd.locate(0,1); + lcd.printf("(0,1)"); + lcd.locate(14,0); + lcd.printf("(19,0)"); + lcd.locate(14,1); + lcd.printf("(19,1)"); + + while (1) { + lcd.locate(0,0); + wait(2); + lcd.locate(0,1); + wait(2); + lcd.locate(19,0); + wait(2); + lcd.locate(19,1); + wait(2); + } +}