Skip to main content

CircuitPython driver for the CST816 capacitive touch screen IC

Project description

Introduction

Discord Build Status Code Style: Black

CircuitPython driver for the CST816 capacitive touch screen IC

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Usage Example

import time
import board
import busio
import cst816

# Initialize I2C
i2c = busio.I2C(board.GP7,board.GP6)
touch = cst816.CST816(i2c)

# Check if the touch controller is detected
if touch.who_am_i():
    print("CST816 detected.")
else:
    print("CST816 not detected.")

# Read touch data continuously
while True:
    point = touch.get_point()
    gesture = touch.get_gesture()
    press = touch.get_touch()
    distance = touch.get_distance()
    print("Position: {0},{1} - Gesture: {2} - Pressed? {3} - Distance: {4},{5}".format(point.x_point, point.y_point, gesture, press, distance.x_dist, distance.y_dist))
    time.sleep(0.05)

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circuitpython-cst816-0.1.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

circuitpython_cst816-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file circuitpython-cst816-0.1.0.tar.gz.

File metadata

  • Download URL: circuitpython-cst816-0.1.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for circuitpython-cst816-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e1226f4f920aba46d3b70f2ad6e9693832d57e948b899b10ffa2144843bcf7c2
MD5 45ecbbd6de8c5205becf75a55b3c2cf3
BLAKE2b-256 406dc781fa4b9a20924864bdf6257646b2285db3c53dce6310584a2a462f6b37

See more details on using hashes here.

File details

Details for the file circuitpython_cst816-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for circuitpython_cst816-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36036242303124a305c4238b0cccced1850073e652116f66115de1abe1ddbb7a
MD5 4994fc49cec78452fdec0a8da77bdd38
BLAKE2b-256 dc407a3ce693fd3879160dac7b041685292846395e64ecdade0121aaaf8a1c90

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page