adding touchio example
adding touchio example for s3 reverse tft
This commit is contained in:
parent
498f3f0fb6
commit
ac2641e279
1 changed files with 18 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
|
||||
# SPDX-License-Identifier: MIT
|
||||
"""
|
||||
CircuitPython Capacitive Two Touch Pin Example - Print to the serial console when a pin is touched.
|
||||
"""
|
||||
import time
|
||||
import board
|
||||
import touchio
|
||||
|
||||
touch_one = touchio.TouchIn(board.A4)
|
||||
touch_two = touchio.TouchIn(board.A5)
|
||||
|
||||
while True:
|
||||
if touch_one.value:
|
||||
print("Pin one touched!")
|
||||
if touch_two.value:
|
||||
print("Pin two touched!")
|
||||
time.sleep(0.1)
|
||||
Loading…
Reference in a new issue