Skip to content

LiquidCrystal_I2C and 1604 LCD setCursor problem at row 3 and 4. #83

@iz2bhp

Description

@iz2bhp

About the problem found years ago on the setCursor command in the row 3 and 4 on 1604 LCD I have modify the file LiquidCrystal_I2C.cpp
at the line: 143 as follow:

void LiquidCrystal_I2C::setCursor(uint8_t col, uint8_t row){
int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
if ( row > _numlines ) {
row = _numlines-1; // we count rows starting w/0
}
if ((row > 1) && (_cols < 20)) {
col -= 4;

}
command(LCD_SETDDRAMADDR | (col + row_offsets[row]));
}

adding these two lines of code I solved the colum problem on row 3 & 4 of 1604LCD.
I have to verify if the 2004 LCD works good also.
If there are better solution to avoid this problem please let me informed.

Kind Regards.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions