Skip to content

Instantly share code, notes, and snippets.

@CelliesProjects
CelliesProjects / mapTouch.ino
Last active July 19, 2019 21:12
Arduino IDE example for ESP32 showing the mapping of XPT2046 touch coordinates to ILI9341 tft coordinates.
/* Map XPT2046 input to ILI9341 320x240 raster */
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <XPT2046_Touchscreen.h> /* https://github.com/PaulStoffregen/XPT2046_Touchscreen */
#define TFT_DC 27
#define _sclk 25
#define _mosi 32 /* 10K pull-up */
#define _miso 39