Sukkin Pang
/
serial_lcd
Serial LCD test
main.cpp
- Committer:
- pangsk
- Date:
- 2011-07-11
- Revision:
- 1:92c28d096a2f
- Parent:
- 0:09a8d78b652a
File content as of revision 1:92c28d096a2f:
/* Serial LCD This program is to demostrate the use of a Serial LCD Serial LCD used: http://www.skpang.co.uk/catalog/product_info.php?cPath=91_100_101&products_id=571 v1.0 August 2010 */ #include "mbed.h" //LCD commands #define COMMAND 0xFE #define CLEAR 0x01 #define LINE0 0x80 #define LINE1 0xC0 DigitalOut myled(LED1); Serial lcd(p9, p10); // tx, rx int main() { wait(2); //Wait for LCD to power up lcd.baud(9600); lcd.putc(COMMAND); lcd.putc(CLEAR); //Clear screen lcd.printf("Hello World"); lcd.putc(COMMAND); lcd.putc(LINE1); //Set cursor to second line lcd.printf("www.skpang.co.uk"); while(1) { myled = 1; wait(0.2); myled = 0; wait(0.2); } }