1. F Malpartida
  2. New LiquidCrystal

Commits

F Malpartida  committed 21149ed

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

  • Participants
  • Parent commits 27d0969
  • Branches V 1.2.0 preparation

Comments (0)

Files changed (3)

File LCD.cpp

View file
  • Ignore whitespace
    command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT);
 }
 
-void LCD::scrollDisplayRight(void) {
+void LCD::scrollDisplayRight(void) 
+{
    command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT);
 }
 
    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) 
 {

File LCD.h

View file
  • Ignore whitespace
    
    /*!
     @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.
     @discussion Turns on automatic scrolling of the LCD. This causes each 
     character output to the display to push previous characters over by one 
    // 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

File keywords.txt

View file
  • Ignore whitespace
 # Datatypes (KEYWORD1)
 ###########################################
 
-LiquidCrystal_SR	 	KEYWORD1
+LiquidCrystal_SR        KEYWORD1
 LiquidCrystal_I2C    	KEYWORD1
 LiquidCrystal_SR_LCD3	KEYWORD1
 LiquidCrystal        	KEYWORD1
 scrollDisplayRight   KEYWORD2
 leftToRight          KEYWORD2
 rightToLeft          KEYWORD2
+moveCursorLeft       KEYWORD2
+moveCursorRight      KEYWORD2
 autoscroll           KEYWORD2
 noAutoscroll         KEYWORD2
 createChar           KEYWORD2