Lint.
This commit is contained in:
parent
86c35fbc68
commit
aeabd11344
1 changed files with 2 additions and 2 deletions
|
|
@ -47,8 +47,8 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Debouncer.git"
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import digitalio
|
import digitalio
|
||||||
import touchio
|
|
||||||
from micropython import const
|
from micropython import const
|
||||||
|
import touchio
|
||||||
|
|
||||||
_DEBOUNCED_STATE = const(0x01)
|
_DEBOUNCED_STATE = const(0x01)
|
||||||
_UNSTABLE_STATE = const(0x02)
|
_UNSTABLE_STATE = const(0x02)
|
||||||
|
|
@ -63,7 +63,7 @@ class Debouncer(object):
|
||||||
:param int interval: bounce threshold in seconds (default is 0.010, i.e. 10 milliseconds)
|
:param int interval: bounce threshold in seconds (default is 0.010, i.e. 10 milliseconds)
|
||||||
"""
|
"""
|
||||||
self.state = 0x00
|
self.state = 0x00
|
||||||
if isinstance(io_or_predicate, digitalio.DigitalInOut) or isinstance(io_or_predicate, touchio.TouchIn):
|
if isinstance(io_or_predicate, (digitalio.DigitalInOut, touchio.TouchIn)):
|
||||||
self.function = lambda: io_or_predicate.value
|
self.function = lambda: io_or_predicate.value
|
||||||
else:
|
else:
|
||||||
self.function = io_or_predicate
|
self.function = io_or_predicate
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue