Go Down

Topic: Right and left alingment on 20x4 i2c lcd display (Read 94 times) previous topic - next topic



does anyone know how to put alignment to print values from right to left, to change pre set left to right alignment on i2c displays, in my case 20x4 display. And can I do it on just some particular rows.


Dec 15, 2017, 08:30 pm Last Edit: Dec 15, 2017, 08:35 pm by floresta
The LCD controller is capable of automatically moving the cursor from right to left by setting I/D (DB1) in the 'Entry mode set' command.  I believe this is handled by the rightToLeft() and leftToRight() commands in the LiquidCrystal library.

Used just once either command will affect all of the rows.  There's no way to change this since the LCD controller doesn't understand the concept of rows.  It is just dealing with memory addresses which are mapped differently on the various display configurations.

On the other hand, you could experiment with issuing the appropriate direction command before printing to each row and accomplish what you are trying to do.  You will probably have to reposition the cursor each time.


Go Up