A library to use XPT2046 touch module
Project description
XPT2046_asukiaaa_python
Python library for XPT2046 Touchscreen. This library references Luca8991/XPT2046-Python and Adafruit_CircuitPython_RGB_Display.
Usage
Enable SPI for Raspberry Pi
sudo raspi-config nonint do_spi 0
No need to reboot.
Wiring
Raspberri Pi | <--> | XPT2046 |
---|---|---|
MOSI (GPIO10) | <--> | DIN |
MISO (GPIO9) | <--> | DO |
SCLK (GPIO11) | <--> | CLK |
GPIO7 or any | <--> | CS |
3V3 | <--> | VCC |
GND | <--> | GND |
This library does not use IRQ pin.
Code, same as in tests/print_touch.py file:
from XPT2046_asukiaaa_python import XPT2046
import board
import busio
from digitalio import DigitalInOut
from time import sleep
cs = DigitalInOut(board.D7)
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
touch = XPT2046(spi, cs=cs)
print("start monitoring touch")
while True:
touch.update()
if touch.coordinate is not None:
print(touch.coordinate)
sleep(.01)
License
MIT
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file XPT2046-asukiaaa-python-1.0.0.tar.gz
.
File metadata
- Download URL: XPT2046-asukiaaa-python-1.0.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49919fea701f5956dc190cba8572035d03c68d3232b0eead0ba515514319d562 |
|
MD5 | 2ba7f4e4ce141142a5c2b4b15a7d7db2 |
|
BLAKE2b-256 | e56000b9df4d9597d3b275ce00e145b13c4b25f8ed6850bf353d54e9a55a59c9 |
File details
Details for the file XPT2046_asukiaaa_python-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: XPT2046_asukiaaa_python-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27f58842b0cb017e2c60470b6ba9d05a2ee8823f19a7b38f37846529aadecf82 |
|
MD5 | e6c9afeb407f5a9142329f8381b3ab9c |
|
BLAKE2b-256 | e1da8591d1515233cf208e1185a1efa64f56a0723708942a26c698836c80a156 |