Adafruit_Learning_System_Gu.../CircuitPython_Quick_Starts/CircuitPython_CapTouch_2Pins.py
2018-03-20 15:34:27 -04:00

16 lines
342 B
Python

# CircuitPython Demo - Cap Touch Multiple Pins
# Example does NOT work with Trinket M0!
import time
import board
import touchio
touch_A1 = touchio.TouchIn(board.A1)
touch_A2 = touchio.TouchIn(board.A2)
while True:
if touch_A1.value:
print("Touched A1!")
if touch_A2.value:
print("Touched A2!")
time.sleep(0.05)