Changing the row of the LCD automatically if the characters exceed

I want to change the row of the LCD when the words exceed. I am controlling my LCD with the serial monitor commands and if the characters are exceeding 16 spaces the other characters disappear. Like if I want to write "hello world how are you?", It will display-

HELLO WORLD HOW

I want that it should be like-

HELLO WORLD HOW ARE YOU ?

please help me out, it will be a great pleasure if someone could solve my problem. Thank you, Regards, Amaan Ram

Perhaps Google "lcd 1602 line wrap".

The HD44780U LCD controller does not have a built-in line wrap capability mainly because there is no way to inform the controller about the configuration of the display that it is driving.

To find out more about this, and to find out what happened to your disappearing characters, you should follow the [u]LCD Addressing[/u] link at http://web.alfredstate.edu/faculty/weimandn.

This problem has to be dealt with in software. Basically you have to count characters and reposition the cursor when necessary.

You no longer have to do this yourself, the hd44780 library which is available via the library manager, has line wrapping capability.

Don

If you use the hd44780 library, you can enable automatic line wrapping using lineWrap() and it will automatically wrap long lines to the next line. The bottom line will wrap back to the top line. It is available in the IDE library manager and includes lots of examples and documentation. link to github page: https://github.com/duinoWitchery/hd44780

--- bill