successful enabled 4-line-mode:
LiquidCrystal.h:
// flags for function set
#define LCD_8BITMODE 0x10
#define LCD_4BITMODE 0x00
#define LCD_REBIT 0x04
#define LCD_2LINE 0x08
#define LCD_1LINE 0x00
#define LCD_5x10DOTS 0x04
#define LCD_5x8DOTS 0x00
//extended function set
#define LCD_4LINE 0x09
LiquidCrystal.cpp:
void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
if (lines == 4) {
_displayfunction |= LCD_REBIT;
} else
...
// finally, set # lines, font size, etc.
command(LCD_FUNCTIONSET | _displayfunction);
if (lines==4)
{
command(LCD_4LINE);
command(LCD_FUNCTIONSET | _displayfunction & !LCD_REBIT );
}
copy of col>12 persists no more (maybe HD44780 mode only supports 12 cols)
the cols (>=12) are also accessable by setcursor
hoping this will be added to the liquidCrystal lib in further arduino-software-versions
attached my LiquidCrystal.h/cpp based on version 0022
changes are marked by "//FW" appended by a char (a=add,d=delete,c=changed) on every changed line
some special chars are not working yet ($ like x), i try to make a conversion table (maybe charset german <> us) and charset us<>display
to get the $ on my display i have to do the following:
char s[]="hello,world ";
s[12]=0xA2;
lcd.print(s);
some special chars (german display):
lcd.setCursor(0,2);//3rd line, first col
char s2[20];
//€ not in charset
s2[0]=0x5B;//Ä
s2[1]=0x5C;//Ö
s2[2]=0x5E;//Ü
s2[3]=0x7B;//ä
s2[4]=0x7C;//ö
s2[5]=0x7E;//ü
s2[6]=0xBE;//ß
s2[7]=0xFD;//{
s2[8]=0xFF;//}
s2[9]=0xA2;//$
s2[10]=0x8F;//µ
s2[11]=0xA0;//@
s2[12]=0xFA;//[
s2[13]=0xFC;//]
s2[14]=0x90;//single note
s2[15]=0x91;//double note
s2[16]=0xDE;//arrow up
s2[17]=0xDF;//arrow right
s2[18]=0xE0;//arrow down
s2[19]=0xE1;//arrow left
s2[20]=0;
lcd.print(s2);