Skip to content

Commit f6b6b1d

Browse files
authored
Merge pull request #14 from FoamyGuy/master
Allowing touchio pins to work without needing import
2 parents edc5bdf + ccc5a19 commit f6b6b1d

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
@@ -46,7 +46,6 @@
4646
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Debouncer.git"
4747

4848
import time
49-
import digitalio
5049
from micropython import const
5150

5251
_DEBOUNCED_STATE = const(0x01)
@@ -62,7 +61,7 @@ def __init__(self, io_or_predicate, interval=0.010):
6261
:param int interval: bounce threshold in seconds (default is 0.010, i.e. 10 milliseconds)
6362
"""
6463
self.state = 0x00
65-
if isinstance(io_or_predicate, digitalio.DigitalInOut):
64+
if hasattr(io_or_predicate, 'value'):
6665
self.function = lambda: io_or_predicate.value
6766
else:
6867
self.function = io_or_predicate

0 commit comments

Comments
 (0)