code.py
1 # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries 2 # 3 # SPDX-License-Identifier: MIT 4 5 """ 6 CircuitPython Capacitive Two Touch Pad Example - Print to the serial console when a pad is touched. 7 """ 8 import time 9 import board 10 import touchio 11 12 touch_one = touchio.TouchIn(board.TOUCH1) 13 touch_two = touchio.TouchIn(board.TOUCH2) 14 15 while True: 16 if touch_one.value: 17 print("Pad one touched!") 18 if touch_two.value: 19 print("Pad two touched!") 20 time.sleep(0.1)