adafruit_debouncedbutton¶
CircuitPython button debouncer
Author(s): hiibot
Implementation Notes¶
Hardware:
Not all hardware / CircuitPython combinations are capable of running the debouncer correctly for an extended length of time. If this line works on your microcontroller, then the debouncer should work forever:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
# * Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice # * Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
Debounce an input button
Make am instance. :param DigitalInOut: the DigitalIO to debounce :param int interval: bounce threshold in seconds (default is 0.010, i.e. 10 milliseconds) :param bool: invert
Return the current is_pressed value.
Return the current is_released value.
Return pressed value.
Update the debouncer state. MUST be called frequently
Return the current was_pressed value.
Return the current was_released value.