16 lines
410 B
Python
16 lines
410 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) # 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)
|