Added new createChar() method. Added new clear() method. Added new scrollDisplayLeft() method. Added new scrollDisplayRight() method. Added support for Arduino alike Custom Character, scroll and clear command interfaces.
Dependents: mbed_lcd_custom MMA8451_ACELEROMETRO_copy
Fork of TextLCD by
Diff: TextLCD.cpp
- Revision:
- 33:ec30a01baf4a
- Parent:
- 32:0a5271dd8a9c
- Child:
- 34:c382632a6e27
--- a/TextLCD.cpp Thu Jul 03 20:01:44 2014 +0000 +++ b/TextLCD.cpp Thu Jul 03 21:04:33 2014 +0000 @@ -318,12 +318,12 @@ // Move cursor to selected row and column void TextLCD::locate(int column, int row) { - // setAddress() does all the heavy lifting: + // setCursor() does all the heavy lifting: // check column and row sanity, // switch controllers for LCD40x4 if needed // switch cursor for LCD40x4 if needed // set the new memory address to show cursor at correct location - setAddress(column, row); + setCursor(column, row); } @@ -670,6 +670,22 @@ } } +void TextLCD::clear() +{ + _writeCommand(0x01); + wait_ms(10); +} + +void TextLCD::scrollDisplayLeft() +{ + _writeCommand(0x10 | 0x08 | 0x00); +} + +void TextLCD::scrollDisplayRight() +{ + _writeCommand(0x10 | 0x08 | 0x04); +} + #if (0) // This is the original _address() method. // It is confusing since it returns the memoryaddress or-ed with the set memorycommand 0x80. @@ -834,7 +850,7 @@ // Set row, column and update memoryaddress. // -void TextLCD::setAddress(int column, int row) { +void TextLCD::setCursor(int column, int row) { // Sanity Check column if (column < 0) {