LCD lines order

Hi, i bought this 20 x 4 lcd display, with an I2C module, and everytrhing works fine with my Arduino Nano.

The only problem is that once a line is filled with characters, it doesn't print in the line immediately below, but it follows this order:

1 --> 3 --> 2 --> 4

Anyone knows how to fix this? It would really make me all simpler.

I'm using a library called LiquidCrystal_I2C.

(Can't find the last answer to this FAQ, so here goes ...)

There is nothing to "fix".

There are four lines on the display.

it is your business to decide what you want to position on each of the four lines, and write code to do it. This is not a VDU terminal, not intended as such.

Mind you, if you install the "HD44780" library using the Library Manager in the IDE and work through the examples, I suspect you will find Bill has something in his code for you. :grinning:

Ukulele_Sauce:
. . .
The only problem is that once a line is filled with characters, it doesn't print in the line immediately below, but it follows this order:

1 --> 3 --> 2 --> 4

That is an inherent characteristic due to the design of the underlying HD44780U controller chip. For a complete explanation follow the LCD Addressing link at Don's Collected Technical Information.

Anyone knows how to fix this? It would really make me all simpler.

Yes, Bill Perry as mentioned previously.

Don

A ‘look up table’ might be an answer.

However, you know what the hardware is doing so you write your code appropriately. :wink:

Ukulele_Sauce:
Anyone knows how to fix this? It would really make me all simpler.

I'm using a library called LiquidCrystal_I2C.

You could switch to the hd44780 library and the hd44780_I2Cexp i/o class.
It has support for long line wrapping which I believe will do what you want.
Install the hd44780 library using the IDE library manager.
Then have a look at the included documentation in the Documentation, example sketch.
After that, run the included I2CexpDiag sketch to test that everything is working.
Once everything is working, you can look at the included hd44780_I2Cexp i/o class examples.
There is one called LineWrap which shows how to enable long line wrapping, which is what I believe you are looking for.

--- bill