In this tutorial we will learn how to connect the TFT 1.44 LCD screen that comes Robo-Geek Kits.
These little LCD screens are handy when working with micro-robotics as it gives a convenient display of 128 x 128 pixels. There are 2 kinds of TFT 1.44, one that includes SD card and the one without with a price of $15 US and $5 US respectively. This tutorial will cover the TFT 1.44 with no SD card.
This tutorial has been tested with Arduino Uno or Arduino Nano. If you have another Arduino board, please review the documentation as the pin layout may be different. Finally we assume that the user has a basic level of understanding how to use Arduino and make electronic connections. If you are new to Arduino world, we strongly suggest to check out this instructable:
Step 1: Downloading the Required Libraries
Add the following libraries to Arduino:
If you are not familiar how to add libraries, refer to this:
Step 2: Wiring TFT 1.44 to Arduino
In the back of the TFT 1.44 LCD screen, we can see the connections from LED to VCC. We suggest to write it down in a piece of paper as shown in the picture with the blue comments.
The TFT fits nicely when using a breadboard. Make sure all pins are in the same row and to install it gently as the pins are delicate. Check the picture to see how the connection looks like.
We have tested the screen several times and we believe a level shifter is optional, so we will be connecting directly from the Arduino to the TFT 1.44 LCD screen.
With respect to Arduino pins
LED to 3.3 V
SCK to D13
SDA to D11
A0 to D8
RST to D9
CS to D10
GND to GND
VCC to 5.0 V
Step 3: The Code: Counting Down
Inspired on the Short Circuit movie, this code produces a counter down to demonstrate the capability of the TFT 1.44 LCD screen. In order to see the final result, check the video.
Step 4: Troubleshooting
If you have trouble running the code, we suggest to do the following:
1. Ensure connections are done properly with a voltmeter
2. If the display is offset in the vertical direction, add a variable to the code:
int yoffset = 32;
Then add yoffset to drawing commands, for example:
tft.drawLine(10,32 + yoffset,10,52 +yoffset, RED);
3. What if Adafruit libraries are not displaying with the desired colors. This is a little hard to solve. Our suggestion, create a small function that display each color and note the number. Affordable electronics require a little more hacking, that's all, it's part of the fun. Check the following colors first, and adjust accordingly.
#define BLACK 0x0000
#define RED 0x001F
#define BLUE 0xF800
#define GREEN 0x07E0
#define YELLOW 0x07FF
#define PURPLE 0xF81F
#define CYAN 0xFFE0
#define WHITE 0xFFFF