TFT Shield Tutorial

About: Student, currently studying programming. Interested in Arduino, Raspberry Pi and Electronics in general.

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

Share

    Recommendations

    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Optics Contest

      Optics Contest
    • Plastics Contest

      Plastics Contest

    2 Discussions

    0
    None
    MikeB648

    Question 9 months ago

    I have mirrored picture...i read datasheet of hx8347g...i found some register,but i dont know how set it to 6,7 bit to 0. Do you meet with this problem?
    Its same 2.4 tft touch display. Init adres 0x7575

    ae_1516798256408.jpg
    1 more answer
    0
    None
    Aleksandar TsvetkovMikeB648

    Answer 9 months ago

    Weird. Registers are quite advanced for me at the moment and I didn't had any issues with it. Have you tried googling it? Good luck!