Skip to main content

A CircuitPython module for the AT42QT2120 capacitive touch sensor IC, (mostly) compatible with Adafruit's MPR121 library.

Project description

CircuitPython-AT42QT2120

Documentation Status Build Status Code Style: Ruff

A CircuitPython module for the AT42QT2120 capacitive touch sensor IC, (mostly) compatible with Adafruit's MPR121 library.

This library's interface is designed after Adafruit's MPR121 module. The ICs diverge in functionality, so we only include functions available on both chips. To determine which functionality is required, I surveyed several consumers of the MPR121 library. This includes three examples from Adafruit, and many of the projects "dependent" on their library on GitHub.

A full list of all the projects I surveyed and their usage of the MPR121 library can be found in the Compatibility Audit. This audit should let us cover enough of the design to use an AT42QT2120 as a drop-in replacement for most users of the MPR121.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install circuitpython-at42qt2120

Usage Example

import busio
import board
from adafruit_bus_device import i2c_device

from at42qt2120 import AT42QT2120

i2c_bus = busio.I2C(board.SCL, board.SDA, frequency=100000)
at = AT42QT2120(i2c_bus)

print(at.touched_pins)
print([at[i].raw_value for i in range(12)])

Documentation

API documentation for this library can be found on Read the Docs.

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_at42qt2120-1.1.1.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

circuitpython_at42qt2120-1.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file circuitpython_at42qt2120-1.1.1.tar.gz.

File metadata

  • Download URL: circuitpython_at42qt2120-1.1.1.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for circuitpython_at42qt2120-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f773e5b3cec003628e3014b3f3af8272955b56816e712ca5a693b1413ed98ba4
MD5 57b73b2d00bfffac61269337247acc0e
BLAKE2b-256 8c6eea473e7df2c12df0d67be0861a8d5589a90d0ff11468ad2c0c93e6392e5d

See more details on using hashes here.

File details

Details for the file circuitpython_at42qt2120-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for circuitpython_at42qt2120-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb2690425b23329e812c787bc7d04b71ee2286eb30714ead7e0e425d452da283
MD5 e352774493c477f08e03e728375b6776
BLAKE2b-256 a2bbe8af625518ff601d2f89c60495259c6ee6c30f7442c6ea9167e509f92825

See more details on using hashes here.

Supported by

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