Simple test
Ensure your device works with this simple test.
examples/ttp229_simpletest.py
1# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2# SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
3#
4# SPDX-License-Identifier: Unlicense
5import time
6
7import board
8
9import ttp229
10
11ttp = ttp229.TTP229(board.GP14, board.GP15, invert_clk=True)
12
13ttp.on_press = lambda i: print(f"Press: {i:d}")
14ttp.on_release = lambda i: print(f"Release: {i:d}")
15
16while True:
17 ttp.update()