A CircuitPython module for the AT42QT2120 capacitive touch sensor IC, (mostly) compatible with Adafruit's MPR121 library.
Project description
CircuitPython-AT42QT2120
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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file circuitpython_at42qt2120-1.1.0.tar.gz.
File metadata
- Download URL: circuitpython_at42qt2120-1.1.0.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeeab132e0f6d08488ab511f05d5089bd0223f0ffd4afcdf51177f6f46cd2ce5
|
|
| MD5 |
c7a835dd0e8936e7ca204adb5bdda3b7
|
|
| BLAKE2b-256 |
36c806b377227a0ed817ca810002eb59091c3098acd25756d64abb5eb494a4fb
|
File details
Details for the file circuitpython_at42qt2120-1.1.0-py3-none-any.whl.
File metadata
- Download URL: circuitpython_at42qt2120-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
541c9a8011b68a5ce76d10858cf6c2e743a932b6296b62b79624a155e22dbdec
|
|
| MD5 |
c0be60d9b621e2cc3e4e56bf59b131a8
|
|
| BLAKE2b-256 |
95f505f16ca7f206ed4a1447ad728accab22c38821086d33c332269b80b03495
|