20x4 LCD Screen only prints to line 0 and 2...

I believe this is because a 4-line LCD display is really two 2-line display controllers connected together. For some reason, the designers used one controller for lines 1 and 3, and the second controller for lines 2 and 4.

This is all wrong for the displays in question, but that is essentially how the 40x4 displays work (except that the rows are grouped as 1-2 and 3-4).

In general almost all of the LCD modules require that the controller be configured as having two lines of memory. This includes all of the displays with four rows of characters, all of the displays with two rows of characters, and most of the single row (16x1) displays as well. One line of memory deals with rows one and three and the other line deals with rows two and four.

Some rare 16x1 displays require that the controller memory be treated as having only one line of memory. If your controller is programmed this way and you attach one of the other displays you cannot display anything on rows two and four (and you also mess up the contrast).

Quiz: Guess which configuration is the default if you omit the lcd.begin() statement, the one that works with the majority of the displays that seem to be out there or the one that works with the few others?

Maybe there's a legitimate electrical engineering reason to do it that way, or maybe someone was just crazy.

It's legitimate when you understand the technical constraints that the engineers were under when they designed this chip more than three decades ago.

In my opinion there's no excuse for the choice of the default configuration if you omit the led.begin() statement, especially since it was not a part of the first 16 versions of the LiquidCrystal library and is therefore missing from all of the old example sketches.

Don