This is a post about getting a graphical full colour LCD screen running with an Arduino.
The sample screen was the ITDB02 1.8″SP unit from iTead Studios.
It is based upon the ST7735 control IC which uses serial data for the display.
First test – fail!
A universal library called the UTFT has been created and is downloadable here. This came as a large download and is designed to be a universal TFT library. It is linked to by iTead for use with the Arduino. The problem I had was that the examples do not explain what the parameters are to initialise the TFT pins with the Arudino. You must initialise the device with the TFT LCD type and the pin mapping. Like this:
// Declare an instance of the class UTFT myGLCD(LPH9135,6,5,2,3,4); // Remember to change the model parameter to suit your display module!
It took me a bit of digging to find that:
// UTFT(byte model, int RS, int WR,int CS, int RST, int SER=0);
I tried to wire this up but did not really know what was meant by int SER=0. Also, on my board there is no WR pin. I presume this is a write line? Documentation on this would have helped. Edit: Or I could just read the manual where this info is available….
I am sure that this library would work OK once connected and initialised correctly, but I could not get it to work. I also found some of the examples too large to fit onto my Arduino AVR.
I searched for the ST7735 LCD controller library and found out that there is a TFT library included with the Aruindo IDE from version 1.0.5.
This was slightly hidden as it dropped off the ‘Examples’ menu on my computer screen, hence I didn’t know it was included.
I wired up the TFT display as shown here and uploaded the TFTGraph example. It worked! I had a streamed graph of the anaolgue data on pin AN0.
|LCD Board Pin||Arduino Pin|
Here are some photos:
This shows the graph example. Data is just random value on the AN0 pin.
(The black line and circle across the display is just marking on a protective cover I have not taken off yet)
This displays a sensor reading in old-school text type.