UNO R3 2.8 TFT Touch Screen With SD Card Socket for Arduino Board Module

92,441

203

33

Posted

Introduction: UNO R3 2.8 TFT Touch Screen With SD Card Socket for Arduino Board Module

Trying to get this touch screen display working has caused some people frustration. The unit came in an anti-static bag as shown in the pictures with a stylus and NO documentation. After searching around I found some libraries and arduino code that worked with this module. After some modifications I was able to execute a simple paint program, number pad, bitmap display (from SD), and a simple screen saver / calibration helper sketch that shows raw data; good for troubleshooting. Read the next steps to find out more information and view the source code examples.

Step 1: Get Connected

Connect your touchscreen shield to the arduino uno board as show in the pictures. There will be two pin slots open on each side.

You can download the number pad sketch along with all the needed libraries here:

https://github.com/dmainmon/myNumberPad

You need to unzip and extract the download then copy the contents of the libraries folder into the Arduino libaries folder: on windows usually it is in \documents\Arduino\libraries

Step 2: Screen Saver and Calibration Helper Sketch

Copy the code example in the demonstration video and upload the sample sketch to an Arduino Uno. This sketch allows you to touch the screen and get raw x, y and transposed x, y coordinates. The raw data is necessary to properly calibrate the touch screen. The sketch also demonstrates shifting states based on touching one of the onscreen buttons. Depending on the state, the program will display a different shape at the location of the touch. The program will also go into a screen saver mode that displays the current state shape.

Step 3: Bitmap Display for UNO R3 2.8 TFT Touch Screen

This sketch demonstrates the standard bitmap display from the SD Micro card inserted into the touch screen. The bitmap files first needed to be copied to the root folder of the SD card. You can do this using a computer. The files need to be named the same as those in the sketch, or you can change the sketch to reflect different file names. Watch the video to view the demonstration and source code.

Step 4: Paint Sample for UNO R3 2.8 TFT

This video demonstrates the standard AdaFruit paint program modified to work with UNO R3 2.8 TFT Touch Screen module.

Step 5: Touch Screen Numeric Pad Example

This video demonstrates a number pad sketch for the UNO R3 2.8 TFT Touch Screen Module. The original sketch had issues on this module. The numbers when touched were reversed on one axis; touching "1" would produce "3" and "4" would produce "6" and middle numbers like "2" and "5" were correct. This sketch fixes this problem by accurately transposing the raw x, y coordinates.

Step 6: Fix for Mirror Display Bug

I connected this module to my Arduino Mega 2560 and uploaded the sketch. When the number pad displayed, all the numbers were in the correct place but everything was mirrored! I uploaded my screen saver sketch and everything worked as expected, no mirroring. I uploaded the paint sketch and that worked as expected as well. So I examined the code and noticed the only difference with the number pad sketch was that the rotation was not set. The number pad uses the default rotation and this value was not set. So I added this to the setup function and everything looked normal.

So if you are using the Arduino Mega 2560, make sure you add the following line to the setup function: tft.setRotation(0);

Step 7: Moving Forward...

Moving forward with this display I decided to do another project graphing analog signals. The project uses two analog signals: one from a photo resistor and one from a mic / amp module.

If you are interested, take a look a the instructable https://www.instructables.com/id/Arduino-Analog-Sig...

Thanks!

2 People Made This Project!

  • Got the display in t...-Nellson

    Nellson made it!

  • I do everything in t...-gymhack

    gymhack made it!

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • First Time Author Contest 2018

    First Time Author Contest 2018
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

19 Comments

This does not work - won't link:

undefined reference to `TouchScreen::TouchScreen(unsigned char, unsigned char, unsigned char, unsigned char, unsigned int)'

undefined reference to `TouchScreen::getPoint()'

Where's my post?

I'm thinking I need an Arduino Mega to do what I want - a Universal Remote. Because after mounting the display there are NO pins left for anything else.

This is so confusing...

And this is coming from someone with an Electronics & Programming background. I am shocked at the dearth of documentation and multiple libraries with multiple dates for this thing. And to find out that it might start out with a Mirror Image - WOW!

I find that Aidafruit has changed a lot since I was there years ago. It too is confusing and some links referenced there are no longer valid.


I am trying to make a truly Universal Remote Control out of this mess. I just got the Arduino Uno & the Display and put it together and there are NO pins left to operate an IR LED.

And just what is the CON1 on the Display Shield? Possibly a way to connect other devices/sensors...?

One thing I did discover is that this is a LGDP4535 clone. That number is mentioned in the sparse so-called users manual that came with the display.

I have downloaded all kinds of libraries suggested in various posts... again, WOW!

Maybe I won't have to take a hammer to it...

There are no ino's for TFT and Aidafruits in the libraries. I'm a newbie to arduino, what am I missing? BTW, I did get the number pad to work.

Thank you for the instructable. I'v been trying to build a DIY smartphone but couldn't get the code or libraries for the touch screen. Now i can finally build it. Thanks.

I'm having issues getting this display to work on my Arduino 101 board with the libraries that are suggested - errors in compiling seem to indicate that the board type isn't supported in the Adafruit_TFTLCD library. Here's a representative error:

" ...\Arduino\libraries\Adafruit_TFTLCD\pin_magic.h:350:3: error: #error "Board type unsupported / not recognized"

#error "Board type unsupported / not recognized" "

I'm expecting that I need to update pin_magic.h to include definitions that support the 101 board to to set the polarity of the data/control lines, but

feedback would be greatly appreciated. And if anyone has the updated file then gaining access to it would also be great!

Thanks, Mike

This video will show you how to fix the inverted display on the Mega

Thank you so much!

Now everything works perfect with my Mega!

Thank you SO MUCH for posting this.

After 3 days of searching the internet, I was still unable to get the resistive touchscreen to work.

I finally got the touchscreen to work correct using your links to the libraries. Found out that this specific TFT display module uses pin 6 & 7 for touch sensor, instead of the standard 4 & 5.

Great overview of this great affordable screen. Can you attach your UNO sketches?