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