touchio — Touch related IO

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

Libraries

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:
  print(touch_pin.value)

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