HazardsMind:
Well if you showed us what display you actually have then we could maybe help you. but you haven't provided us with any links.
You said you were using the ILI9341 display and it was on a stackable board, perhaps this library is what you need.
GitHub - adafruit/Adafruit_ILI9341: Library for Adafruit ILI9341 displays
No those ones don't work, they are the ones i get the problem: wont start the touchscreen
I used these to test the touch: GitHub - adafruit/Adafruit_TouchScreen: Arduino library for 4-wire resistive touchscreens
Code:
#include <stdint.h>
#include "TouchScreen.h"
// These are the pins for the shield!
#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
#define MINPRESSURE 10
#define MAXPRESSURE 1000
// For better pressure precision, we need to know the resistance
// between X+ and X- Use any multimeter to read it
// For the one we're using, its 300 ohms across the X plate
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
void setup(void) {
Serial.begin(9600);
}
void loop(void) {
// a point object holds x y and z coordinates
TSPoint p = ts.getPoint();
// we have some minimum pressure we consider 'valid'
// pressure of 0 means no pressing!
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {
Serial.print("X = "); Serial.print(p.x);
Serial.print("\tY = "); Serial.print(p.y);
Serial.print("\tPressure = "); Serial.println(p.z);
}
}
and this one to test the TFT: LCD display with ILI9341 driver on Arduino - Displays - Arduino Forum
Code:
#include <stdint.h>
#include "TFTv2.h"
#include "SPI.h"
void setup()
{
TFT_BL_ON; // turn on the background light
Tft.TFTinit(); // init TFT library
}
void loop()
{
for(int r=0;r<115;r=r+2) //set r : 0--115
{
Tft.drawCircle(119,160,r,random(0xFFFF)); //draw circle, center:(119, 160), color: random
}
delay(10);
}