Nobuki HIRAMINE
/
lcd
Display a string to the LCD.
main.cpp@0:4de64ea3fd75, 2012-06-17 (annotated)
- Committer:
- nobuki
- Date:
- Sun Jun 17 03:47:53 2012 +0000
- Revision:
- 0:4de64ea3fd75
Version 1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nobuki | 0:4de64ea3fd75 | 1 | #include "mbed.h" |
nobuki | 0:4de64ea3fd75 | 2 | #include "TextLCD.h" |
nobuki | 0:4de64ea3fd75 | 3 | |
nobuki | 0:4de64ea3fd75 | 4 | TextLCD g_lcd(p15, p16, p17, p18, p19, p20); // RS, E, DB4, DB5, DB6, DB7 |
nobuki | 0:4de64ea3fd75 | 5 | |
nobuki | 0:4de64ea3fd75 | 6 | int main() { |
nobuki | 0:4de64ea3fd75 | 7 | wait(0.001); |
nobuki | 0:4de64ea3fd75 | 8 | g_lcd.cls(); wait(0.001); |
nobuki | 0:4de64ea3fd75 | 9 | g_lcd.locate(0, 0); |
nobuki | 0:4de64ea3fd75 | 10 | g_lcd.printf( "Hello world!"); |
nobuki | 0:4de64ea3fd75 | 11 | |
nobuki | 0:4de64ea3fd75 | 12 | int iCounter = 0; |
nobuki | 0:4de64ea3fd75 | 13 | while(1) { |
nobuki | 0:4de64ea3fd75 | 14 | g_lcd.locate(0, 1); |
nobuki | 0:4de64ea3fd75 | 15 | g_lcd.printf( "%d", iCounter ); |
nobuki | 0:4de64ea3fd75 | 16 | iCounter++; |
nobuki | 0:4de64ea3fd75 | 17 | wait(1.0); |
nobuki | 0:4de64ea3fd75 | 18 | } |
nobuki | 0:4de64ea3fd75 | 19 | } |