Added moveCursorRight and moveCursorLeft generic methods to interface as an extension to the library.

This commit is contained in:
FMC
2012-02-21 22:00:39 +01:00
parent cee7fad69f
commit dca5a87ac9
3 changed files with 37 additions and 4 deletions
+15 -1
View File
@@ -232,7 +232,8 @@ void LCD::scrollDisplayLeft(void)
command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT);
}
void LCD::scrollDisplayRight(void) {
void LCD::scrollDisplayRight(void)
{
command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT);
}
@@ -250,6 +251,19 @@ void LCD::rightToLeft(void)
command(LCD_ENTRYMODESET | _displaymode);
}
// This method moves the cursor one space to the right
void LCD::moveCursorRight(void)
{
command(LCD_CURSORSHIFT | LCD_CURSORMOVE | LCD_MOVERIGHT);
}
// This method moves the cursor one space to the left
void LCD::moveCursorLeft(void)
{
command(LCD_CURSORSHIFT | LCD_CURSORMOVE | LCD_MOVELEFT);
}
// This will 'right justify' text from the cursor
void LCD::autoscroll(void)
{
+19 -2
View File
@@ -291,6 +291,23 @@ public:
*/
void rightToLeft();
/*!
@function
@abstract Moves the cursor one space to the left.
@discussion
@param none
*/
void moveCursorLeft();
/*!
@function
@abstract Moves the cursor one space to the right.
@param none
*/
void moveCursorRight();
/*!
@function
@abstract Turns on automatic scrolling of the LCD.
@@ -433,9 +450,9 @@ protected:
// Internal LCD variables to control the LCD shared between all derived
// classes.
uint8_t _displayfunction; // LCD_5x10DOTS or LCD_5x8DOTS, LCD_4BITMODE or
// LCD_8BITMODE, LCD_1LINE or LCD_2LINE
// LCD_8BITMODE, LCD_1LINE or LCD_2LINE
uint8_t _displaycontrol; // LCD base control command LCD on/off, blink, cursor
// all commands are "ored" to its contents.
// all commands are "ored" to its contents.
uint8_t _displaymode; // Text entry mode to the LCD
uint8_t _numlines; // Number of lines of the LCD, initialized with begin()
uint8_t _cols; // Number of columns in the LCD
+3 -1
View File
@@ -6,7 +6,7 @@
# Datatypes (KEYWORD1)
###########################################
LiquidCrystal_SR KEYWORD1
LiquidCrystal_SR KEYWORD1
LiquidCrystal_I2C KEYWORD1
LiquidCrystal_SR_LCD3 KEYWORD1
LiquidCrystal KEYWORD1
@@ -29,6 +29,8 @@ scrollDisplayLeft KEYWORD2
scrollDisplayRight KEYWORD2
leftToRight KEYWORD2
rightToLeft KEYWORD2
moveCursorLeft KEYWORD2
moveCursorRight KEYWORD2
autoscroll KEYWORD2
noAutoscroll KEYWORD2
createChar KEYWORD2