the bundle:
adafruit_mpr121.mpy
adafruit_bus_device
Before continuing make sure your board's lib folder or root filesystem has the adafruit_mpr121.mpy, and
adafruit_bus_device files and folders copied over.
Next connect to the board's serial REPL (https://adafru.it/Awz) so you are at the CircuitPython >>> prompt.
Python Installation of MPR121 Library
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This may also
require enabling I2C on your platform and verifying you are running Python 3. Since each platform is a little different,
and Linux changes often, please visit the CircuitPython on Linux guide to get your computer
ready (https://adafru.it/BSN)!
Once that's done, from your command line run the following command:
sudo pip3 install adafruit-circuitpython-mpr121
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use
CircuitPython on Python 2.x, it isn't supported!
CircuitPython & Python Usage
To demonstrate the usage of the sensor we'll initialize it and read capacitive touch from the board's Python REPL.
If you're using an I2C connection run the following code to import the necessary modules and initialize the I2C
connection with the sensor:
Now you're ready to read capacitive touch from the sensor. Use the following syntax to check a specific pin.
mpr121[i].value - Return True if the specified pin is being touched, otherwise returns False.
Use a value 0 to 11 for [i] and it will return a boolean True or False value depending on if the input is currently being
touched or not.
For example, to print when pin 0 is touched, run the following code, and then touch pin 0: