MicroPython driver for MPR121 capacitive touch keypads and breakout boards.
Compatible with:
- SparkFun Capacitive Touch Keypad - MPR121 (discontinued)
- MPR121 Capacitive Touch Keypad
- MPR121 Capacitive Touch Breakout Board
These boards use 3.3V logic, so you would want to use a logic level converter with this for 5V systems.
Copy the file to your device, using ampy, webrepl or compiling and deploying. eg.
$ ampy put mpr121.py
Basic usage
import mpr121
from machine import Pin
i2c = machine.I2C(3)
mpr = mpr121.MPR121(i2c, 0x5A)
print(mpr.touched())
For more detailed examples, see /examples
- VCC-GND STM32F407VET6 mini $15.47 AUD
- MPR121 Capacitive Touch Keypad $2.88 AUD
- Female-Female Dupont wires $0.64 AUD
STM32F407VET6 | MPR121 Capacitive Touch Keypad |
---|---|
3V3 (or 5V) | VCC |
D3 (any pin) | IRQ |
A8 (SPI3 SCL) | SCL |
C9 (SPI3 SDA) | SDA |
GND | GND |
Licensed under the MIT License.