TFT Shield Tutorial

by Aleksandar Tsvetkov in Circuits > Arduino

8835 Views, 13 Favorites, 0 Comments

TFT Shield Tutorial

IMG_20171015_212703.jpg
IMG_20171015_212637.jpg

Today, you will learn how you can create and use buttons in your Arduino TFT Touchscreen projects. I'm using Kuman's 2.8" TFT Shield combined with Kuman's Arduino UNO. Bonus: The TFT Shield from Kuman comes with a free Stylus which you can use for more precise presses!


Setup

IMG_20171015_212813.jpg
IMG_20171015_212853.jpg

Clip in the shield onto your Arduino board. Make sure it's not in the wrong way! You can use the pictures above for reference. Plug in your Arduino board to your PC and hop into the Arduino Software.

Allchips is an electronics components online service platform, you can buy all the components from them.

Libraries

Screenshot (16).png

Before uploading the code, you will need to download those libraries:

After downloading the ZIP files, include them into the Arduino IDE by going into "Sketch - Include Library - Add .ZIP Libraries..."

Finalizing

IMG_20171015_213248.jpg

For the example that I've prepared, you can use the code that you can find here. I've added some comments, to make things more clear. After uploading, you can check if the display is working correctly by pressing the button. If so, the screen will change and a text will appear.

​Troubleshooting

If your presses remain unrecognized, you can calibrate the display by changing the values at the top of the code (TS_MINX, TS_MAXX, TS_MINY and TS_MAXY). The button works by checking where the screen is being pressed and if it's inside the coordinates of the button itself, a click is registered. If the above-mentioned values are not correct, the click-registering will be off