Introduction: TFT Shield Tutorial
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!
Step 1: Setup
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.
Step 2: Libraries
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..."
Step 3: Finalizing
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.
Step 4: 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