diff --git a/README.adoc b/README.adoc new file mode 100644 index 0000000..6f57eb1 --- /dev/null +++ b/README.adoc @@ -0,0 +1,24 @@ += Liquid Crystal Library for Arduino = + +This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. + +For more information about this library please visit us at +http://arduino.cc/en/Reference/LiquidCrystal + +== License == + +Copyright (c) Arduino LLC. All right reserved. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/examples/Autoscroll/Autoscroll.ino b/examples/Autoscroll/Autoscroll.ino index 1127d8f..0acb3af 100644 --- a/examples/Autoscroll/Autoscroll.ino +++ b/examples/Autoscroll/Autoscroll.ino @@ -1,14 +1,14 @@ /* LiquidCrystal Library - Autoscroll - + Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the + library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. - + This sketch demonstrates the use of the autoscroll() and noAutoscroll() functions to make new text scroll or not. - + The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 @@ -20,16 +20,16 @@ * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) - + Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 - by Tom Igoe + by Tom Igoe modified 22 Nov 2010 by Tom Igoe - + This example code is in the public domain. http://arduino.cc/en/Tutorial/LiquidCrystalAutoscroll @@ -43,8 +43,8 @@ LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { - // set up the LCD's number of columns and rows: - lcd.begin(16,2); + // set up the LCD's number of columns and rows: + lcd.begin(16, 2); } void loop() { @@ -52,12 +52,12 @@ void loop() { lcd.setCursor(0, 0); // print from 0 to 9: for (int thisChar = 0; thisChar < 10; thisChar++) { - lcd.print(thisChar); - delay(500); + lcd.print(thisChar); + delay(500); } // set the cursor to (16,1): - lcd.setCursor(16,1); + lcd.setCursor(16, 1); // set the display to automatically scroll: lcd.autoscroll(); // print from 0 to 9: @@ -67,7 +67,7 @@ void loop() { } // turn off automatic scrolling lcd.noAutoscroll(); - + // clear screen for the next loop: lcd.clear(); } diff --git a/examples/Blink/Blink.ino b/examples/Blink/Blink.ino index 9667b5d..856d522 100644 --- a/examples/Blink/Blink.ino +++ b/examples/Blink/Blink.ino @@ -1,14 +1,14 @@ /* LiquidCrystal Library - Blink - + Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the + library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. - - This sketch prints "Hello World!" to the LCD and makes the + + This sketch prints "Hello World!" to the LCD and makes the cursor block blink. - + The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 @@ -20,20 +20,20 @@ * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) - + Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 - by Tom Igoe + by Tom Igoe modified 22 Nov 2010 by Tom Igoe - + This example code is in the public domain. http://arduino.cc/en/Tutorial/LiquidCrystalBlink - + */ // include the library code: @@ -43,7 +43,7 @@ LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { - // set up the LCD's number of columns and rows: + // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); @@ -53,7 +53,7 @@ void loop() { // Turn off the blinking cursor: lcd.noBlink(); delay(3000); - // Turn on the blinking cursor: + // Turn on the blinking cursor: lcd.blink(); delay(3000); } diff --git a/examples/Cursor/Cursor.ino b/examples/Cursor/Cursor.ino index 05862a4..5f68d91 100644 --- a/examples/Cursor/Cursor.ino +++ b/examples/Cursor/Cursor.ino @@ -1,15 +1,15 @@ /* LiquidCrystal Library - Cursor - + Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the + library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. - + This sketch prints "Hello World!" to the LCD and uses the cursor() and noCursor() methods to turn on and off the cursor. - + The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 @@ -21,13 +21,13 @@ * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) - + Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 - by Tom Igoe + by Tom Igoe modified 22 Nov 2010 by Tom Igoe @@ -44,7 +44,7 @@ LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { - // set up the LCD's number of columns and rows: + // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); @@ -54,7 +54,7 @@ void loop() { // Turn off the cursor: lcd.noCursor(); delay(500); - // Turn on the cursor: + // Turn on the cursor: lcd.cursor(); delay(500); } diff --git a/examples/CustomCharacter/CustomCharacter.ino b/examples/CustomCharacter/CustomCharacter.ino index f714a3a..e70a949 100644 --- a/examples/CustomCharacter/CustomCharacter.ino +++ b/examples/CustomCharacter/CustomCharacter.ino @@ -1,14 +1,14 @@ /* LiquidCrystal Library - Custom Characters - - Demonstrates how to add custom characters on an LCD display. - The LiquidCrystal library works with all LCD displays that are - compatible with the Hitachi HD44780 driver. There are many of + + Demonstrates how to add custom characters on an LCD display. + The LiquidCrystal library works with all LCD displays that are + compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. - + This sketch prints "I Arduino!" and a little dancing man to the LCD. - + The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 @@ -29,13 +29,13 @@ Based on Adafruit's example at https://github.com/adafruit/SPI_VFD/blob/master/examples/createChar/createChar.pde - + This example code is in the public domain. http://www.arduino.cc/en/Tutorial/LiquidCrystal - + Also useful: http://icontexto.com/charactercreator/ - + */ // include the library code: @@ -111,15 +111,15 @@ void setup() { // create a new character lcd.createChar(2, frownie); // create a new character - lcd.createChar(3, armsDown); + lcd.createChar(3, armsDown); // create a new character - lcd.createChar(4, armsUp); + lcd.createChar(4, armsUp); // Print a message to the lcd. lcd.print("I "); lcd.write(byte(0)); // when calling lcd.write() '0' must be cast as a byte lcd.print(" Arduino! "); - lcd.write(1); + lcd.write((byte) 1); } @@ -136,5 +136,5 @@ void loop() { lcd.setCursor(4, 1); // draw him arms up: lcd.write(4); - delay(delayTime); + delay(delayTime); } diff --git a/examples/Display/Display.ino b/examples/Display/Display.ino index a85effb..5c9e67c 100644 --- a/examples/Display/Display.ino +++ b/examples/Display/Display.ino @@ -1,15 +1,15 @@ /* LiquidCrystal Library - display() and noDisplay() - + Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the + library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. - - This sketch prints "Hello World!" to the LCD and uses the + + This sketch prints "Hello World!" to the LCD and uses the display() and noDisplay() functions to turn on and off the display. - + The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 @@ -21,13 +21,13 @@ * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) - + Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 - by Tom Igoe + by Tom Igoe modified 22 Nov 2010 by Tom Igoe @@ -44,7 +44,7 @@ LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { - // set up the LCD's number of columns and rows: + // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); @@ -54,7 +54,7 @@ void loop() { // Turn off the display: lcd.noDisplay(); delay(500); - // Turn on the display: + // Turn on the display: lcd.display(); delay(500); } diff --git a/examples/HelloWorld/HelloWorld.ino b/examples/HelloWorld/HelloWorld.ino index eaf0f6f..bf122d9 100644 --- a/examples/HelloWorld/HelloWorld.ino +++ b/examples/HelloWorld/HelloWorld.ino @@ -1,14 +1,14 @@ /* LiquidCrystal Library - Hello World - + Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the + library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. - + This sketch prints "Hello World!" to the LCD and shows the time. - + The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 @@ -22,7 +22,7 @@ * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) - + Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 @@ -31,7 +31,7 @@ by Tom Igoe modified 22 Nov 2010 by Tom Igoe - + This example code is in the public domain. http://www.arduino.cc/en/Tutorial/LiquidCrystal @@ -44,7 +44,7 @@ LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { - // set up the LCD's number of columns and rows: + // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); @@ -55,6 +55,6 @@ void loop() { // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: - lcd.print(millis()/1000); + lcd.print(millis() / 1000); } diff --git a/examples/Scroll/Scroll.ino b/examples/Scroll/Scroll.ino index 0d6d8dc..3e44791 100644 --- a/examples/Scroll/Scroll.ino +++ b/examples/Scroll/Scroll.ino @@ -1,15 +1,15 @@ /* LiquidCrystal Library - scrollDisplayLeft() and scrollDisplayRight() - + Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the + library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. - + This sketch prints "Hello World!" to the LCD and uses the scrollDisplayLeft() and scrollDisplayRight() methods to scroll the text. - + The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 @@ -21,18 +21,18 @@ * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) - + Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 - by Tom Igoe + by Tom Igoe modified 22 Nov 2010 by Tom Igoe - + This example code is in the public domain. - + http://arduino.cc/en/Tutorial/LiquidCrystalScroll */ @@ -44,7 +44,7 @@ LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { - // set up the LCD's number of columns and rows: + // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); @@ -52,11 +52,11 @@ void setup() { } void loop() { - // scroll 13 positions (string length) to the left + // scroll 13 positions (string length) to the left // to move it offscreen left: for (int positionCounter = 0; positionCounter < 13; positionCounter++) { // scroll one position left: - lcd.scrollDisplayLeft(); + lcd.scrollDisplayLeft(); // wait a bit: delay(150); } @@ -65,20 +65,20 @@ void loop() { // to move it offscreen right: for (int positionCounter = 0; positionCounter < 29; positionCounter++) { // scroll one position right: - lcd.scrollDisplayRight(); + lcd.scrollDisplayRight(); // wait a bit: delay(150); } - - // scroll 16 positions (display length + string length) to the left - // to move it back to center: + + // scroll 16 positions (display length + string length) to the left + // to move it back to center: for (int positionCounter = 0; positionCounter < 16; positionCounter++) { // scroll one position left: - lcd.scrollDisplayLeft(); + lcd.scrollDisplayLeft(); // wait a bit: delay(150); } - + // delay at the end of the full loop: delay(1000); diff --git a/examples/SerialDisplay/SerialDisplay.ino b/examples/SerialDisplay/SerialDisplay.ino index a6f8f40..5838dc5 100644 --- a/examples/SerialDisplay/SerialDisplay.ino +++ b/examples/SerialDisplay/SerialDisplay.ino @@ -1,14 +1,14 @@ /* LiquidCrystal Library - Serial Input - + Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the + library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. - - This sketch displays text sent over the serial port + + This sketch displays text sent over the serial port (e.g. from the Serial Monitor) on an attached LCD. - + The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 @@ -20,18 +20,18 @@ * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) - + Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 - by Tom Igoe + by Tom Igoe modified 22 Nov 2010 by Tom Igoe - + This example code is in the public domain. - + http://arduino.cc/en/Tutorial/LiquidCrystalSerial */ @@ -41,8 +41,8 @@ // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); -void setup(){ - // set up the LCD's number of columns and rows: +void setup() { + // set up the LCD's number of columns and rows: lcd.begin(16, 2); // initialize the serial communications: Serial.begin(9600); diff --git a/examples/TextDirection/TextDirection.ino b/examples/TextDirection/TextDirection.ino index cabd8ea..3bb8695 100644 --- a/examples/TextDirection/TextDirection.ino +++ b/examples/TextDirection/TextDirection.ino @@ -1,40 +1,40 @@ - /* - LiquidCrystal Library - TextDirection - - Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the - Hitachi HD44780 driver. There are many of them out there, and you - can usually tell them by the 16-pin interface. - - This sketch demonstrates how to use leftToRight() and rightToLeft() - to move the cursor. - - The circuit: - * LCD RS pin to digital pin 12 - * LCD Enable pin to digital pin 11 - * LCD D4 pin to digital pin 5 - * LCD D5 pin to digital pin 4 - * LCD D6 pin to digital pin 3 - * LCD D7 pin to digital pin 2 - * LCD R/W pin to ground - * 10K resistor: - * ends to +5V and ground - * wiper to LCD VO pin (pin 3) - - Library originally added 18 Apr 2008 - by David A. Mellis - library modified 5 Jul 2009 - by Limor Fried (http://www.ladyada.net) - example added 9 Jul 2009 - by Tom Igoe - modified 22 Nov 2010 - by Tom Igoe - - This example code is in the public domain. - - http://arduino.cc/en/Tutorial/LiquidCrystalTextDirection - - */ +/* +LiquidCrystal Library - TextDirection + +Demonstrates the use a 16x2 LCD display. The LiquidCrystal +library works with all LCD displays that are compatible with the +Hitachi HD44780 driver. There are many of them out there, and you +can usually tell them by the 16-pin interface. + +This sketch demonstrates how to use leftToRight() and rightToLeft() +to move the cursor. + +The circuit: +* LCD RS pin to digital pin 12 +* LCD Enable pin to digital pin 11 +* LCD D4 pin to digital pin 5 +* LCD D5 pin to digital pin 4 +* LCD D6 pin to digital pin 3 +* LCD D7 pin to digital pin 2 +* LCD R/W pin to ground +* 10K resistor: +* ends to +5V and ground +* wiper to LCD VO pin (pin 3) + +Library originally added 18 Apr 2008 +by David A. Mellis +library modified 5 Jul 2009 +by Limor Fried (http://www.ladyada.net) +example added 9 Jul 2009 +by Tom Igoe +modified 22 Nov 2010 +by Tom Igoe + +This example code is in the public domain. + +http://arduino.cc/en/Tutorial/LiquidCrystalTextDirection + +*/ // include the library code: #include @@ -45,7 +45,7 @@ LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int thisChar = 'a'; void setup() { - // set up the LCD's number of columns and rows: + // set up the LCD's number of columns and rows: lcd.begin(16, 2); // turn on the cursor: lcd.cursor(); @@ -55,17 +55,17 @@ void loop() { // reverse directions at 'm': if (thisChar == 'm') { // go right for the next letter - lcd.rightToLeft(); + lcd.rightToLeft(); } // reverse again at 's': if (thisChar == 's') { // go left for the next letter - lcd.leftToRight(); + lcd.leftToRight(); } // reset at 'z': if (thisChar > 'z') { // go to (0,0): - lcd.home(); + lcd.home(); // start again at 0 thisChar = 'a'; } diff --git a/examples/setCursor/setCursor.ino b/examples/setCursor/setCursor.ino index 951c8a5..4790b68 100644 --- a/examples/setCursor/setCursor.ino +++ b/examples/setCursor/setCursor.ino @@ -1,14 +1,14 @@ /* LiquidCrystal Library - setCursor - + Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the + library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. - + This sketch prints to all the positions of the LCD using the setCursor(0 method: - + The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 @@ -20,18 +20,18 @@ * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) - + Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 - by Tom Igoe + by Tom Igoe modified 22 Nov 2010 by Tom Igoe - + This example code is in the public domain. - + http://arduino.cc/en/Tutorial/LiquidCrystalSetCursor */ @@ -48,8 +48,8 @@ const int numCols = 16; LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { - // set up the LCD's number of columns and rows: - lcd.begin(numCols,numRows); + // set up the LCD's number of columns and rows: + lcd.begin(numCols, numRows); } void loop() { @@ -60,7 +60,7 @@ void loop() { // loop over the rows: for (int thisRow = 0; thisRow < numCols; thisRow++) { // set the cursor position: - lcd.setCursor(thisCol,thisRow); + lcd.setCursor(thisCol, thisRow); // print the letter: lcd.write(thisLetter); delay(200); diff --git a/keywords.txt b/keywords.txt old mode 100755 new mode 100644 index 132845c..4ee24d9 --- a/keywords.txt +++ b/keywords.txt @@ -30,6 +30,7 @@ rightToLeft KEYWORD2 scrollDisplayLeft KEYWORD2 scrollDisplayRight KEYWORD2 createChar KEYWORD2 +setRowOffsets KEYWORD2 ####################################### # Constants (LITERAL1) diff --git a/library.properties b/library.properties new file mode 100644 index 0000000..05d2c9f --- /dev/null +++ b/library.properties @@ -0,0 +1,9 @@ +name=LiquidCrystal +version=1.0 +author= +maintainer=Arduino +sentence=Allows communication with alphanumerical liquid crystal displays (LCDs). For all Arduino boards. +paragraph=This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. The library works with in either 4 or 8 bit mode (i.e. using 4 or 8 data lines in addition to the rs, enable, and, optionally, the rw control lines). +category=Display +url=http://arduino.cc/en/Reference/LiquidCrystal +architectures=* diff --git a/LiquidCrystal.cpp b/src/LiquidCrystal.cpp similarity index 93% rename from LiquidCrystal.cpp rename to src/LiquidCrystal.cpp index d7bd9e4..249e0ec 100644 --- a/LiquidCrystal.cpp +++ b/src/LiquidCrystal.cpp @@ -87,10 +87,11 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { _displayfunction |= LCD_2LINE; } _numlines = lines; - _currline = 0; + + setRowOffsets(0x00, 0x40, 0x00 + cols, 0x40 + cols); // for some 1 line displays you can select a 10 pixel high font - if ((dotsize != 0) && (lines == 1)) { + if ((dotsize != LCD_5x8DOTS) && (lines == 1)) { _displayfunction |= LCD_5x10DOTS; } @@ -157,6 +158,14 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { } +void LiquidCrystal::setRowOffsets(int row0, int row1, int row2, int row3) +{ + _row_offsets[0] = row0; + _row_offsets[1] = row1; + _row_offsets[2] = row2; + _row_offsets[3] = row3; +} + /********** high level commands, for the user! */ void LiquidCrystal::clear() { @@ -172,12 +181,15 @@ void LiquidCrystal::home() void LiquidCrystal::setCursor(uint8_t col, uint8_t row) { - int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 }; + const size_t max_lines = sizeof(_row_offsets) / sizeof(*_row_offsets); + if ( row >= max_lines ) { + row = max_lines - 1; // we count rows starting w/0 + } if ( row >= _numlines ) { - row = _numlines-1; // we count rows starting w/0 + row = _numlines - 1; // we count rows starting w/0 } - command(LCD_SETDDRAMADDR | (col + row_offsets[row])); + command(LCD_SETDDRAMADDR | (col + _row_offsets[row])); } // Turn the display on/off (quickly) diff --git a/LiquidCrystal.h b/src/LiquidCrystal.h old mode 100755 new mode 100644 similarity index 96% rename from LiquidCrystal.h rename to src/LiquidCrystal.h index 24ec5af..da950ce --- a/LiquidCrystal.h +++ b/src/LiquidCrystal.h @@ -77,6 +77,7 @@ public: void autoscroll(); void noAutoscroll(); + void setRowOffsets(int row1, int row2, int row3, int row4); void createChar(uint8_t, uint8_t[]); void setCursor(uint8_t, uint8_t); virtual size_t write(uint8_t); @@ -100,7 +101,8 @@ private: uint8_t _initialized; - uint8_t _numlines,_currline; + uint8_t _numlines; + uint8_t _row_offsets[4]; }; #endif