Testbed for ExtTextLCD

Dependencies:   mbed

main.cpp

Committer:
osmeest
Date:
2011-02-05
Revision:
0:0a32d52ad7db

File content as of revision 0:0a32d52ad7db:

// 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);
    }
}