Skip to content

Commit d523a15

Browse files
committed
finally check in captouch-only hwtest
1 parent 1301d5b commit d523a15

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# pico_test_synth_hwtest_captouch.py -- test pico_test_synth captouch pads
2+
# 15 Feb 2024 - @todbot / Tod Kurt
3+
# Note: requires a wide terminal (110chars)
4+
import time
5+
import board
6+
import touchio
7+
8+
touch_pins = (
9+
board.GP0, board.GP1, board.GP2, board.GP3, board.GP4, board.GP5,
10+
board.GP6, board.GP7 ,board.GP8, board.GP9, board.GP10, board.GP11,
11+
board.GP12, board.GP13, board.GP14, board.GP15 )
12+
13+
touchins = []
14+
for pin in touch_pins:
15+
print("touch pin:", pin) # print here let's us diagnose if a pin is bad
16+
touchin = touchio.TouchIn(pin)
17+
touchin.threshold = int(touchin.threshold * 1.05)
18+
touchins.append(touchin)
19+
20+
while True:
21+
print("touch:","".join(['1' if t.value else '0' for t in touchins]),
22+
"".join(["%4d " % t.raw_value for t in touchins]))
23+
time.sleep(0.05)

0 commit comments

Comments
 (0)