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