I plan to control 2 graphic LCD (http://www.sparkfun.com/products/710
) using the KS0108 Graphics LCD library (http://www.arduino.cc/playground/Code/GLCDks0108
The library assumes you use one port (A,B or C) to connect one LCD.
I would like to know what I should modify in the library to use 2 LCDs?
Do I need to duplicate the library changing all functions name to address LCD 1 or LCD 2 (e.g. GLCD.ClearScreen1() for LCD 1 and GLCD.ClearScreen2() for LCD 2) ? Or is there any more elegant way to do it?
So far I am a user of the existing libraries but didn’t try myself to write one…
Thank you for your support.
Note: I am using a Mega 2560
The library can run dual displays. I did this during the development of the new level code
that is in the current v3 beta version of the library.
I'd insert a photo of this running the demo sketches, but this forum
does not allow posting images.
(Yes I know it allows linking but I'm not going to upload it somewhere else)
There is a trick though. You must trick the library into "thinking" it is on larger display.
So rather than having 2 separate displays you change the config file to say it is
a 128x128 display with 4 chip selects.
The great thing is that it only takes 2 additional pins to do this.
Wiring up the displays is pretty simple as all the other pins,
D0-D7, EN, RW, DI, are all shared and wired together.
Then what you end up with is a 128x128 display is split across dual displays.
Not quite the same as 2 independent displays, but still very usable.
You can set up text areas that are limited to a single which makes text very easy.
For the graphics you have to be a bit careful not to transverse between the two
displays. And avoid things like GLCD.ClearScreen()
I have to go right now, but can elaborate further if you need more assistance.