Skip to main content

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.

Metadata

Release files for circuitpython-at42qt2120 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for circuitpython-at42qt2120 1.1.1
File Size Uploaded
circuitpython_at42qt2120-1.1.1.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for circuitpython-at42qt2120 1.1.1
File Interpreter ABI Platform
circuitpython_at42qt2120-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.5 kB

Release files / circuitpython_at42qt2120-1.1.1.tar.gz

Download URL circuitpython_at42qt2120-1.1.1.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f773e5b3cec003628e3014b3f3af8272955b56816e712ca5a693b1413ed98ba4
BLAKE2b-256 checksum
How to use checksums
8c6eea473e7df2c12df0d67be0861a8d5589a90d0ff11468ad2c0c93e6392e5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / circuitpython_at42qt2120-1.1.1-py3-none-any.whl

Download URL circuitpython_at42qt2120-1.1.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb2690425b23329e812c787bc7d04b71ee2286eb30714ead7e0e425d452da283
BLAKE2b-256 checksum
How to use checksums
a2bbe8af625518ff601d2f89c60495259c6ee6c30f7442c6ea9167e509f92825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page