I've got a 40x4 display that has similar pinouts to the usual HD44780, except that it has dual ST7066U controllers (each 40x2 ?) and dual enable lines. Does anyone know if it is possible to spoof the library by setting one or other of the enable lines myself before writing to the display, thus allowing the use of all four lines ?
I've never tried this (other than it compiles), but can you not just have two instances of display, and give each the same data pins?
Like this:
#include <LiquidCrystal.h>
LiquidCrystal lcd[2] = {LiquidCrystal(12, 11, 5, 4, 3, 2),LiquidCrystal(12, 10, 5, 4, 3, 2)}; //Note they have a different EN pin
void setup() {
// set up the LCD's number of columns and rows:
lcd[0].begin(40, 2);
lcd[1].begin(40, 2);
//First controller
lcd[0].setCursor(0, 0);
lcd[0].print("this is line 0");
lcd[0].setCursor(0, 1);
lcd[0].print("this is line 1");
//second controller
lcd[1].setCursor(0, 0);
lcd[1].print("this is line 2");
}
void loop() {
lcd[1].setCursor(0, 1);
// print the number of seconds since reset:
lcd[1].print(millis()/1000);
}
I've got a 40x4 display that has similar pinouts to the usual HD44780, except that it has dual ST7066U controllers (each 40x2 ?) and dual enable lines. Does anyone know if it is possible to spoof the library by setting one or other of the enable lines myself before writing to the display, thus allowing the use of all four lines ?
Why don't you just use a library that is designed for this type of device? Check out Google Code Archive - Long-term storage for Google Code Project Hosting..
Don
I've never tried this (other than it compiles), but can you not just have two instances of display, and give each the same data pins?
That technique works also. Check this out: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1265969050 (scroll down).
Don
Thanks for the guidance... I've got it running using the two instances method... same pins except for the enables. Apart from the numerous other bugs in my program, it works fine.
For info, the backlight takes about 1/2 amp.
For info, the backlight takes about 1/2 amp.
Did you use a series current limiting resistor?
Don
They do take quite a bit of current. If they are anything like the ones I have previously used in a project, you can get away with a 4.7R resistor and can limit it to about 100mA, but anything more than that, it wont come one.
... you can get away with a 4.7R resistor and can limit it to about 100mA, but anything more than that, it wont come one.
That looks about right.
The datasheet indicates a typical forward current of 480 mA when the forward voltage is 4.2 V which would suggest a 1.67 ohm resistor. With no resistor the maximum forward voltage rating of 4.6 V would be exceeded and the LED current would be limited only by the supply characteristics.
Don
Yes, the current requirement is HUGE (on the CMOS scale) and will need its own regulation in the final build. Not enough and it doesn't light, too much and it will fry. I used a bench power supply with voltage and current limiters to check it out.
floresta:
I've got a 40x4 display that has similar pinouts to the usual HD44780, except that it has dual ST7066U controllers (each 40x2 ?) and dual enable lines. Does anyone know if it is possible to spoof the library by setting one or other of the enable lines myself before writing to the display, thus allowing the use of all four lines ?
Why don't you just use a library that is designed for this type of device? Check out Google Code Archive - Long-term storage for Google Code Project Hosting..
Don
Oh, that is freaking sweet. I had no idea that existed and I have one of those displays too. Time to switch over to that library. Thanks!