LCD optimizations and additions
One of my first posts contains a LCD prototype. Today I needed LCD functionality and made some optimizations and additions to the LCD prototype.
Speed up
In the LCD3Wire library, I removed two delays:
131c131 < //delay(1); --- > delay(1); 155c155 < //delayMicroseconds(1); --- > delayMicroseconds(10);
This gives a good speed increase when using the LCD3Wire library. Furthermore, reading this post (http://solar-blogg.blogspot.com/2009/02/displaying-custom-5×8-characters-on.html) I copied the code to the Arduino and displayed my own custom character (using the LCD3Wire library)
lcd.commandWrite(0x40); lcd.print(0b00000); lcd.print(0b00100); lcd.print(0b00010); lcd.print(0b11111); lcd.print(0b00010); lcd.print(0b00100); lcd.print(0b00000); lcd.print(0b00000); lcd.cursorTo(1,0); lcd.print(0x00);
And another great LCD speedup trick by designer2k2 on the Arduino forums is to avoid using lcd.cursorTo. Instead use his direct positioning code
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1240088162
lcd.commandWrite(0x80); //Line=1, Cursor 0 lcd.commandWrite(0xC0+val); //Line=2, Cursor val lcd.commandWrite(0x94+7); //Line=3, Cursor 7 lcd.commandWrite(0xD4); //Line=4, Cursor 0