adafruit_mpr121
¶
CircuitPython driver for the MPR121 capacitive touch breakout board.
See usage in the examples/simpletest.py file.
Author(s): Tony DiCola
Implementation Notes¶
Hardware:
Adafruit 12-Key Capacitive Touch Sensor Breakout - MPR121 (Product ID: 1982)
Adafruit 12 x Capacitive Touch Shield for Arduino - MPR121 (Product ID: 2024)
Software and Dependencies:
Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_mpr121.MPR121(i2c: I2C, address: int = 90)[source]¶
Driver for the MPR121 capacitive touch breakout board.
- baseline_data(pin: int) int [source]¶
Get the baseline data register value.
- Parameters:
pin (int) – The pin to read (0 - 11).
- Raises:
ValueError – Argument
pin
is invalid.- Returns:
The baseline data value stored in the register.
- Return type:
- filtered_data(pin: int) int [source]¶
Get the filtered data register value.
- Parameters:
pin (int) – The pin to read (0 - 11).
- Raises:
ValueError – Argument
pin
is invalid.- Returns:
The filtered data value stored in the register.
- Return type:
- is_touched(pin: int) bool [source]¶
Get if
pin
is being touched.- Raises:
ValueError – Argument
pin
is invalid.- Returns:
True if
pin
is being touched; otherwise False.- Return type:
- reset() None [source]¶
Reset the MPR121 into a default state.
All configurations and states previously set are lost.
- Raises:
RuntimeError – The sensor is in an invalid config state.