14 lines
419 B
Python
14 lines
419 B
Python
"""CircuitPython Essentials Capacitive Touch on two pins example. Does not work on Trinket M0!"""
|
|
import time
|
|
import board
|
|
import touchio
|
|
|
|
touch_A1 = touchio.TouchIn(board.A1) # Not a touch pin on Trinket M0!
|
|
touch_A2 = touchio.TouchIn(board.A2) # Not a touch pin on Trinket M0!
|
|
|
|
while True:
|
|
if touch_A1.value:
|
|
print("Touched A1!")
|
|
if touch_A2.value:
|
|
print("Touched A2!")
|
|
time.sleep(0.05)
|