Intro: How to Use 2.4 Inch TFT LCD SPFD5408 With Arduino Uno and Mega
This Instructable is to know how to work TFT 2.4 with the controller SPFD5408
with the libraries of Adafruit for TFT.
This library is the Adafruit TFT Libraries changed to works in TFT 2.4 shields with the SPFD5408 controller.
Now it is for Uno and Mega, Teensy is on the way...
It is based in the last version of Adafruit, inclusive with buttons features.
The TFT 2.4 is cheap TFT, that generally is from China, without documentation or libraries for it.
I tested some mcufriend shields.
When we try to use the TFT 2.4 with SPFD5408 controller in sketches with Adafruit TFT libraries, several things can happen :
- White Screen
- All screen with noise
- Touch not works or is inverted (coordinate Y)
- The colors are inverted
- And other things
After trying for several days trying the solutions I found on the web, and none works 100%. So I decided to do an library specific to this controller.
I changed the Adafruit libraries for TFT: GFX , TFTLCD and TouchScreen. I join all in this one library, the library SPFD5408, to avoid problems with duplicate libraries and enables also have the original library Adafruit ready for use in other projects with another TFT hardware.
Step 1: Download the SPFD5408 Library
I made available it in my GitHub .
Please download it in: https://github.com/JoaoLopesF/SPFD5408
Attention: This library is ONLY for SPFD5408 TFT controller
If it not work, and you get a blank screen,
please access this site to help you identify the correct library:
Step 2: Install
Please follow the details in README.
Step 3: First Test - Graphicstest
I modified the Adafruit graphicstest to work.
Please open the folder in spfd5408_graphicstest sketch example.
Upload this to Arduino Uno
Step 4: Test 2 - Tftpaint
TftPaint is a sketch from Adafruit_TFTLCD, is a one simple paint, but important for learning and test the TFT.
I modified this to work.
Please open the folder in spfd5408_tftpaint sketch example
Step 5: Utility - Calibrate
This TFT is with a resistive touch, and need calibration for accurate the touch
I made one sketch to help this process.
Please open the folder in spfd5408_calibration sketch example.
After the run of this program , you have the parameters of calibration to put in your sketch code.