Post
by andrew » Thu Apr 14, 2016 4:02 pm
This is actually a 'quirk' of the IC (HD44780) that controls the display and is used in most LCD character displays. The controller IC has an area of memory where it stores the text to be displayed. However the controller is designed two work with several different formats of LCD, e.g, 16x2, 20x4, 40x2 but it doesn't know what format of LCD it is controlling so it doesn't know how to map its memory to the display. In the case of the 20x4 screen (2004) it maps the first 20 bytes, 0 - 19 to the first line of the display, bytes 20 to 39 to the 3rd line, bytes 40 to 59 to the second line, and finally bytes 60 to 79 to the fourth line.
Unfortunately I don't think there is any easy way around this, you will have to split the lines yourself and use the setCursor() function to position the text on the correct line.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.