Adafruit_Learning_System_Gu.../CircuitPython_Essentials/CircuitPython_CapTouch.py
2018-05-14 19:07:55 +01:00

14 lines
285 B
Python

import time
import board
import touchio
touch_pad = board.A0 # Will not work for Circuit Playground Express!
# touch_pad = board.A1 # For Circuit Playground Express
touch = touchio.TouchIn(touch_pad)
while True:
if touch.value:
print("Touched!")
time.sleep(0.05)