We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3569774 + 0961c83 commit 78bfed3Copy full SHA for 78bfed3
examples/debouncer_touchio_test.py
@@ -0,0 +1,25 @@
1
+"""
2
+This example shows how to use the debouncer library on the signals coming from
3
+a cap-sense pin with touchio.
4
5
+import time
6
+import board
7
+import touchio
8
+from adafruit_debouncer import Debouncer
9
+
10
+touch_pad = board.A1
11
+touch = touchio.TouchIn(touch_pad)
12
+touch_debounced = Debouncer(touch)
13
14
+while True:
15
+ touch_debounced.update()
16
+ if touch_debounced.fell:
17
+ print("Just released")
18
+ if touch_debounced.rose:
19
+ print("Just pressed")
20
+ if touch_debounced.value:
21
+ print("touching")
22
+ else:
23
+ # print('not touching')
24
+ pass
25
+ time.sleep(0.05)
0 commit comments