@@ -79,6 +79,8 @@ void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t en
7979 else
8080 _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS;
8181
82+ setRowOffsets (0x00 , 0x40 , 0x14 , 0x54 );
83+
8284 begin (16 , 1 );
8385}
8486
@@ -157,6 +159,14 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
157159
158160}
159161
162+ void LiquidCrystal::setRowOffsets (int row0, int row1, int row2, int row3)
163+ {
164+ _row_offsets[0 ] = row0;
165+ _row_offsets[1 ] = row1;
166+ _row_offsets[2 ] = row2;
167+ _row_offsets[3 ] = row3;
168+ }
169+
160170/* ********* high level commands, for the user! */
161171void LiquidCrystal::clear ()
162172{
@@ -172,12 +182,11 @@ void LiquidCrystal::home()
172182
173183void LiquidCrystal::setCursor (uint8_t col, uint8_t row)
174184{
175- int row_offsets[] = { 0x00 , 0x40 , 0x14 , 0x54 };
176185 if ( row >= _numlines ) {
177- row = _numlines- 1 ; // we count rows starting w/0
186+ row = _numlines - 1 ; // we count rows starting w/0
178187 }
179188
180- command (LCD_SETDDRAMADDR | (col + row_offsets [row]));
189+ command (LCD_SETDDRAMADDR | (col + _row_offsets [row]));
181190}
182191
183192// Turn the display on/off (quickly)
0 commit comments