XPT2046_Touch (community library)
Summary
Name | Value |
---|---|
Name | XPT2046_Touch |
Version | 1.1.7 |
Installs | |
License | MIT |
Author | Paul Stoffregen, ported by Volker Ritzka |
URL | https://github.com/vritzka/XPT2046_Touch |
Repository | https://github.com/vritzka/XPT2046_Touch |
Download | .tar.gz |
All Versions | 1.1.7, 1.1.6, 1.1.4, 1.1.3, 1.1.1 |
Library for the CPT2046 Touch chip
Example Build Testing
Device OS Version:
This table is generated from an automated build. Success only indicates that the code compiled successfully.
Library Read Me
This content is provided by the library maintainer and has not been validated or approved.
XPT2046 Touch sensor chip for Particle
A Particle library for XPT2046.
Ported from Paul Stoffregen's Arduino version.
Usage
Connect the chip like this
DO --- MISO A4 DI --- MOSI A5 CLK --- SCK A3 SS -- (you will chose this pin in the application)
The library can use SPI or SPI1.
#include "XPT2046_touch.h"
#define CS_PIN D5 //ChipSelect or SlaveSelect Pin
#define TIRQ_PIN D1 // interrupt pin
XPT2046_Touchscreen ts(SPI, CS_PIN, TIRQ_PIN);
void setup() {
ts.begin();
ts.setRotation(3);
Serial.begin();
}
void loop() {
if (ts.touched()) {
TS_Point p = ts.getPoint();
Serial.print("Pressure = ");
Serial.print(p.z);
Serial.print(", x = ");
Serial.print(p.x);
Serial.print(", y = ");
Serial.print(p.y);
delay(30);
Serial.println();
}
}
See the examples folder for more details.
Licensed under the MIT license
Browse Library Files