-
Notifications
You must be signed in to change notification settings - Fork 108
Home
This library is a Adafruit’s libraries for TFT changed to works with SPFD5408 controller of cheap TFT 2.4 Shield
I moved the libraries GFX, TFTLCD and Touch for one library, the SPFD5408.
I did this to facilitate installation , minimize problems due to duplicate libraries and enable use the original Adafruit for other projects with other TFT
Due to variations in Chinese shields with some controller, there is no guarantee that will work for everyone.
I’ll try a more suppliers in aliexpress to test more variations.
Please let me know if this happens.
Also please send me feedback, problems or suggestions.
You can copy the code of SPFD5408 library examples for your sketch;
or if you download any code that uses Adafruit Libraries, please verify it:
#include <SPFD5408_Adafruit_GFX.h> // Core graphics library
#include <SPFD5408_Adafruit_TFTLCD.h> // Hardware-specific library
#include <SPFD5408_TouchScreen.h> // Touch library
(insert the SPFD5408_ prefix to use this library instead the Adafruit libraries)
#define YP A1 // must be an analog pin, use "An" notation!
#define XM A2 // must be an analog pin, use "An" notation!
#define YM 7 // can be a digital pin
#define XP 6 // can be a digital pin
—- Calibrate before run
Exists one sketch written for my, to help in calibration of touch
See it in examples folder
Run it and change this parameters:
#define TS_MINX 150
#define TS_MINY 120
#define TS_MAXX 920
#define TS_MAXY 940
————————
All changes in Adafruit code and examples is marked with:
// ### SPFD5408 change -- Begin
(change)
// ### SPFD5408 change -- End
——————
Examples:
adafruit_originals
From Adafruit Libraries — Not works with the SPFD5408
spfd5408_calibrate
Help the calibration of touch (resistive)
spfd5408_tftpaint
example of Adafruit changed to work with the SPFD5408
spfd5408_graphictest
example of Adafruit changed to work with the SPFD5408
spfd5408_rotationtest
example of Adafruit changed to work with the SPFD5408