loading

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!

<p>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.</p>
Got the display in the Mail today and immediately hooked it up. Got a big white nothing. Tried all sorts of libraries but when I tried the button code in this instructable, it just worked.<br><br> The resistive touch is a little off, and when I load the paint example my Y axis (short axis) is reversed.<br><br>But very happy!
<p>Try setting the rotation to zero in the setup function. This might solve the reversed axis issue.</p>
<p>same problem with Y-axis. could use help</p>
<p>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.</p>
<p>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:</p><p>&quot; ...\Arduino\libraries\Adafruit_TFTLCD\pin_magic.h:350:3: error: #error &quot;Board type unsupported / not recognized&quot;</p><p> #error &quot;Board type unsupported / not recognized&quot; &quot;</p><p>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 </p><p>feedback would be greatly appreciated. And if anyone has the updated file then gaining access to it would also be great!</p><p>Thanks, Mike</p>
<p>This video will show you how to fix the inverted display on the Mega</p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/guGaU7fM5KU" width="500"></iframe></p>
<p>Thank you so much!</p><p>Now everything works perfect with my Mega!</p>
<p>I do everything in this tutorial but my LCD doesn't work, it just stay the same. What can be wrong? </p>
<p>I posted the code including the libraries. Usually this type of issue is due to the incorrect libraries. <a href="https://github.com/dmainmon/myNumberPad" rel="nofollow">https://github.com/dmainmon/myNumberPad</a></p>
<p>Thanks for the libraries</p><p>Now LCD works well with my mega2560</p><p>But the display looks inverted. How do I solve this issue??</p>
<p>Already solved it? Same problem here.</p>
<p>Also I got this with the graphicstest</p>
<p>Try these libraries:</p><p>https://github.com/dmainmon/myNumberPad</p>
<p>Hi ,</p><p>I am also finding the same problem with my LCD. Did you find a solution to this?</p>
<p>Try the libraries in this download:</p><p>https://github.com/dmainmon/myNumberPad</p>
<p>Try using the libraries in this download:</p><p>https://github.com/dmainmon/myNumberPad</p>
<p>Thank you SO MUCH for posting this.</p><p>After 3 days of searching the internet, I was still unable to get the resistive touchscreen to work. </p><p>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 &amp; 7 for touch sensor, instead of the standard 4 &amp; 5.</p>
<p>Great overview of this great affordable screen. Can you attach your UNO sketches?</p>
<p>I never received a response on this, so went through the painful process of copying code from the video. It can be found here for others that might need it. Not that this has some minor changes, but is fully functional and I will continue to refine: https://github.com/siliconghost/Arduino_2.8in_TFT_wSD</p>
<p>To get your code working I needed to use these Libriaries i found in MCUfriend.com</p><p>http://forum.arduino.cc/index.php?topic=292777.0</p>
<p>You can download the libraries used in this here:</p><p>https://github.com/dmainmon/myNumberPad</p>
<p>Same here. These are the only libraries that worked for me. Currently going through the changes so i can understand what had to be done to make this display work.</p><p>Thanks for the link. It is a relief to see the display finally working!</p>
<p>i have two questions:</p><p>- There is a sketch for sleeping display (on/off or sleep mode)?</p><p>- How can i connect this display with Arduno Nano ? </p>
<p>How do I plug it into the Mega?</p>
<p>This instructable uses this TFT with a Mega. <a href="https://www.instructables.com/id/Arduino-Analog-Signal-Graphing-on-a-TFT-Touch-Scre/">https://www.instructables.com/id/Arduino-Analog-Sig...</a></p><p>You should be able to adapt the code. The main thing to pay attention to are the initialization variables at the top before the setup and loop functions.</p>
<p>Do I need to include all three libraries, all I am doing is displaying sensor values on the screen, no touch button interaction?</p>
<p>awesome project </p>

About This Instructable

68,717views

194favorites

License:

Bio: Will write code for food. :) If you need help with any of your embedded Arduino applications please send me a message.
More by dmainmon:ArduCAM Mini ESP8266 Web Camera ESP8266-12E DHT Thermostat ESP8266 OLED Clock IoT Using AJAX 
Add instructable to: