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.0.tar.gz (22.1 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.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for circuitpython_at42qt2120-1.1.0.tar.gz
Algorithm Hash digest
SHA256 aeeab132e0f6d08488ab511f05d5089bd0223f0ffd4afcdf51177f6f46cd2ce5
MD5 c7a835dd0e8936e7ca204adb5bdda3b7
BLAKE2b-256 36c806b377227a0ed817ca810002eb59091c3098acd25756d64abb5eb494a4fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for circuitpython_at42qt2120-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 541c9a8011b68a5ce76d10858cf6c2e743a932b6296b62b79624a155e22dbdec
MD5 c0be60d9b621e2cc3e4e56bf59b131a8
BLAKE2b-256 95f505f16ca7f206ed4a1447ad728accab22c38821086d33c332269b80b03495

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