Skip to content

Commit c21f541

Browse files
committed
remove dependency on touchio
1 parent aeabd11 commit c21f541

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

adafruit_debouncer.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import time
4949
import digitalio
5050
from micropython import const
51-
import touchio
5251

5352
_DEBOUNCED_STATE = const(0x01)
5453
_UNSTABLE_STATE = const(0x02)
@@ -63,7 +62,7 @@ def __init__(self, io_or_predicate, interval=0.010):
6362
:param int interval: bounce threshold in seconds (default is 0.010, i.e. 10 milliseconds)
6463
"""
6564
self.state = 0x00
66-
if isinstance(io_or_predicate, (digitalio.DigitalInOut, touchio.TouchIn)):
65+
if hasattr(io_or_predicate, 'value'):
6766
self.function = lambda: io_or_predicate.value
6867
else:
6968
self.function = io_or_predicate

0 commit comments

Comments
 (0)