A driver code library for Text LCD panels using the 4-bit HD44780 lcd display driver.
Dependents: LCD16x2FREEDOM tarea1 XtrinsicSensorEVK congolcd ... more
Fork of TextLCD by
Revision 8:122fc41ed965, committed 2012-12-09
- Comitter:
- sbts
- Date:
- Sun Dec 09 09:43:55 2012 +0000
- Parent:
- 7:44f34c09bd37
- Commit message:
- add LCDtype LCD40x2 for compatibility with 2 line 40 character displays
Changed in this revision
TextLCD.cpp | Show annotated file Show diff for this revision Revisions of this file |
TextLCD.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 44f34c09bd37 -r 122fc41ed965 TextLCD.cpp --- a/TextLCD.cpp Sat Dec 04 11:29:57 2010 +0000 +++ b/TextLCD.cpp Sun Dec 09 09:43:55 2012 +0000 @@ -129,6 +129,7 @@ return 0x80 + (row * 40) + column; case LCD16x2: case LCD20x2: + case LCD40x2: default: return 0x80 + (row * 0x40) + column; } @@ -136,6 +137,8 @@ int TextLCD::columns() { switch (_type) { + case LCD40x2: + return 40; case LCD20x4: case LCD20x2: return 20; @@ -153,6 +156,7 @@ case LCD16x2: case LCD16x2B: case LCD20x2: + case LCD40x2: default: return 2; }
diff -r 44f34c09bd37 -r 122fc41ed965 TextLCD.h --- a/TextLCD.h Sat Dec 04 11:29:57 2010 +0000 +++ b/TextLCD.h Sun Dec 09 09:43:55 2012 +0000 @@ -27,13 +27,13 @@ /** A TextLCD interface for driving 4-bit HD44780-based LCDs * - * Currently supports 16x2, 20x2 and 20x4 panels + * Currently supports 16x2, 20x2 , 20x4 and 40x2 panels * * @code * #include "mbed.h" * #include "TextLCD.h" * - * TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, e, d4-d7 + * TextLCD lcd(p10, p12, p15, p16, p29, p30, TextLCD::LCD16x2); // rs, e, d4-d7, LCDType * * int main() { * lcd.printf("Hello World!\n"); @@ -49,6 +49,7 @@ , LCD16x2B /**< 16x2 LCD panel alternate addressing */ , LCD20x2 /**< 20x2 LCD panel */ , LCD20x4 /**< 20x4 LCD panel */ + , LCD40x2 /**< 40x2 LCD panel */ }; /** Create a TextLCD interface