ILI9341 SHIELD Touchscreen initial Setup


Hello
Does anyone have experience with this TFT Shield.
Using Adafruits examples, the graphics display fine.
But when I try and use the touchscreen, nothing.
I have tried setting YP=A1, XM=A2, YM=7 & XP=6 (#define TFT_YP A1)

my initial setup includes...
#include <TouchScreen.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h> // include Adafruit ILI9341 TFT library
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;

// The STMPE610 uses hardware SPI on the shield, and #8
#define STMPE_CS 8
Adafruit_STMPE610 ts = Adafruit_STMPE610(STMPE_CS);
// The display also uses hardware SPI, plus #9 & #10
#define TFT_CS 10
#define TFT_DC 9
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
#define TFT_YP A1
#define TFT_XM A2
#define TFT_YM 7
#define TFT_XP 6

Many thanks

@newbcoder, Hi,

Please post a link to where you bought your display. It may have information to help us help you.
Does your display have a touch overlay? It would be a resistive overlay with direct connection to analog pins.

MCUFRIEND_kbv supports these kinds of displays, including touch overlay. See examples.
MCUFRIEND_kbv is known by Library Manager. Install using Library Manager.

Don't use a mixture of Adafruit TFT drivers and MCUFriend_kbv.
I don't know Adafruit_STMPE610, but I don't think your display has this kind of touch controller.

Solved
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h> // include Adafruit ILI9341 TFT library
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;
#include <TouchScreen.h>

const int XP = 8, XM = A2, YP = A3, YM = 9; //ID=0x9341
const int TS_LEFT = 114, TS_RT = 915, TS_TOP = 69, TS_BOT = 911;

I used MCUFRIEND's touchscreen calibration program to get the board settings and the On/Off button program to test the settings.

Good luck people, this has been a two day trial.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.