//I need to change the pins below for it to work. NOt sure why#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

// 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 plateTouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

Sketch code

Check out the links above for our tutorials and wiring diagrams These displays use SPI to communicate, 4 or 5 pins are required to interface (RST is optional) Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries. MIT license, all text above must be included in any redistribution ****************************************************///Sketch Modified by KB1UIF (A.Tedds)//Working for the Banggood 2.4" Shield.//Using 8bit Communication for ili9341 or Samsung Driver Chip!!