duinoWitchery / hd44780

Extensible hd44780 LCD library
GNU General Public License v3.0
234 stars 56 forks source link

I2Cexp_BOARD_SUNROM does not care about begin's cols #43

Open swimm3r opened 9 months ago

swimm3r commented 9 months ago

Hello,

I use the lib with the following: hd44780_I2Cexp lcd(0x3f, I2Cexp_BOARD_SUNROM); and lcd.begin(7, 2);

The cols = 7 is not considered. The display shows how many chars he want.

bperrybap commented 9 months ago

Not sure what you mean by this. Do you really have a 7x2 display? The geometry parameters are to tell the library the actual geometry of the LCD panel. It tells the library how to do the mapping for column zero of each row.

If you want linewrappig behavior i.e. linewrapping to the next line/row at the column of the specified geometry, you have to enable linewrapping. And if line wrapping is enabled, then the column specified in begin() is very much used. It is used to determine where to wrap the character output. See the hd44780 API documentation and included example sketches for how to use the lineWrap() function.

bperrybap commented 9 months ago

At bit more on this. If you print more characters on a line/row then the display has, the characters will be stored in DDRAM but will not show on the LCD. But if you continue to print, they will eventually start showing up on another line. That is how the hd44780 chip set works.

If you say the display has fewer columns than the actual display has in begin(), then characters for the actual columns on the LCD will still show up. For example: if the display is 16x2 but you tell the library it is 7,2 then when you print beyond column 7, the characters will show up on the line, This is do to how the hd447780 chip set maps its characters to the LCD. If the display were really 7x2, then characters printed after column would be stored DDRAM but not show up on the display.

The line wrapping capability in the library, does line wrapping at the specified column when enabled.

--- bill