touchio — Touch related IO

The touchio module contains classes to provide access to touch IO typically accelerated by hardware on the onboard microcontroller.


All libraries change hardware state and should be deinitialized when they are no longer needed. To do so, either call deinit() or use a context manager.

For example:

import touchio
from board import *

with touchio.TouchIn(D6) as touch_pin:

This example will initialize the the device, run value and then deinit() the hardware.