To allow the display to be changed back from a two line display
to a one line display
The following three lines of code:
if (lines > 1) {
_displayfunction |= LCD_2LINE;
}
should be changed to:
if (lines > 1) {
_displayfunction |= LCD_2LINE;
}
else {
_displayfunction &= ~LCD_2LINE;
}