Introduction
Capacitive touch sensing using Pico / Pico2 / RP2040 / RP2350 PIO, using touchio API
Dependencies
This driver depends on:
RP2040- or RP2350-based microcontrollers (as it uses their PIO module)
Hardware
Each touch pad connects to a GPIO pin with a ~1MΩ resistor to ground (pull-down, the default) or to 3.3V (pull-up). Pads can be exposed copper, foil tape, conductive fabric, etc.
This library only works on RP2040- or RP2350-based boards like the Raspberry Pi Pico, QTPY RP2040, and similar.
Usage Example
import touchpio
import board
touch = touchpio.TouchIn(board.GP2)
while True:
if touch.value:
print("touched!")
Installing to a Connected CircuitPython Device with Circup
Make sure that you have circup installed in your Python environment.
Install it with the following command if necessary:
pip3 install circup
With circup installed and your CircuitPython device connected use the
following command to install:
circup install touchpio
Or the following command to update an existing version:
circup update
Documentation
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
References
Originally from 23 Feb 2023 picotouch_grid research
Uses ideas from PIO Capsense experiment / -scottiebabe 2022
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Table of Contents
API Reference