Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-debouncer/badge/?version=latest
:target: https://docs.circuitpython.org/projects/debouncer/en/latest/
:alt: Documentation Status
.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_Debouncer/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_Debouncer/actions/
:alt: Build Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black
Debounces an arbitrary predicate function (typically created as a lambda) of 0 arguments.
The constructor also accepts a digital pin as a convienence.
Dependencies
=============
This driver depends on:
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `Adafruit Ticks <https://github.com/adafruit/Adafruit_CircuitPython_Ticks>`_
Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
Usage Example
=============
.. code-block:: python
import board
import digitalio
from adafruit_debouncer import Debouncer
pin = digitalio.DigitalInOut(board.D12)
pin.direction = digitalio.Direction.INPUT
pin.pull = digitalio.Pull.UP
switch = Debouncer(pin)
while True:
switch.update()
if switch.fell:
print('Just pressed')
if switch.rose:
print('Just released')
if switch.value:
print('not pressed')
else:
print('pressed')
Documentation
=============
API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/debouncer/en/latest/>`_.
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_debouncer/blob/main/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Raw data
{
"_id": null,
"home_page": "",
"name": "adafruit-circuitpython-debouncer",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "adafruit,blinka,circuitpython,micropython,debouncer,debounce",
"author": "",
"author_email": "Adafruit Industries <circuitpython@adafruit.com>",
"download_url": "https://files.pythonhosted.org/packages/fa/71/1caf2a89cc2dcdb5b0aa645ecc30254f1fb70aaf7fc2404486485b38c23d/adafruit-circuitpython-debouncer-2.0.8.tar.gz",
"platform": null,
"description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-debouncer/badge/?version=latest\n :target: https://docs.circuitpython.org/projects/debouncer/en/latest/\n :alt: Documentation Status\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n :target: https://adafru.it/discord\n :alt: Discord\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_Debouncer/workflows/Build%20CI/badge.svg\n :target: https://github.com/adafruit/Adafruit_CircuitPython_Debouncer/actions/\n :alt: Build Status\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: Code Style: Black\n\nDebounces an arbitrary predicate function (typically created as a lambda) of 0 arguments.\nThe constructor also accepts a digital pin as a convienence.\n\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n* `Adafruit Ticks <https://github.com/adafruit/Adafruit_CircuitPython_Ticks>`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.\n\nUsage Example\n=============\n\n.. code-block:: python\n\n import board\n import digitalio\n from adafruit_debouncer import Debouncer\n\n pin = digitalio.DigitalInOut(board.D12)\n pin.direction = digitalio.Direction.INPUT\n pin.pull = digitalio.Pull.UP\n switch = Debouncer(pin)\n\n while True:\n switch.update()\n if switch.fell:\n print('Just pressed')\n if switch.rose:\n print('Just released')\n if switch.value:\n print('not pressed')\n else:\n print('pressed')\n\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/debouncer/en/latest/>`_.\n\nFor information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_debouncer/blob/main/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "CircuitPython pin or arbitrary predicate debouncer.",
"version": "2.0.8",
"project_urls": {
"Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_Debouncer"
},
"split_keywords": [
"adafruit",
"blinka",
"circuitpython",
"micropython",
"debouncer",
"debounce"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "39ab8d86791701381665c28eb0fabf0d5530fc08813e3ea69180a84ef0e0de72",
"md5": "cd17a0923763f4dbf74e1907de06c204",
"sha256": "b0c4100f39c14ebc590e79c74fda1df8e49ef890ecdfe0bafd6cf4297fc58e22"
},
"downloads": -1,
"filename": "adafruit_circuitpython_debouncer-2.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cd17a0923763f4dbf74e1907de06c204",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5710,
"upload_time": "2023-12-09T17:44:08",
"upload_time_iso_8601": "2023-12-09T17:44:08.395139Z",
"url": "https://files.pythonhosted.org/packages/39/ab/8d86791701381665c28eb0fabf0d5530fc08813e3ea69180a84ef0e0de72/adafruit_circuitpython_debouncer-2.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fa711caf2a89cc2dcdb5b0aa645ecc30254f1fb70aaf7fc2404486485b38c23d",
"md5": "d1f9cad20107e8fe84d4745cb919b525",
"sha256": "cc8f54c19dc3b8c1bfcf0afd3b33f3b9e62dbf681339fb953c64fee3ac2cf0c9"
},
"downloads": -1,
"filename": "adafruit-circuitpython-debouncer-2.0.8.tar.gz",
"has_sig": false,
"md5_digest": "d1f9cad20107e8fe84d4745cb919b525",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 28905,
"upload_time": "2023-12-09T17:44:09",
"upload_time_iso_8601": "2023-12-09T17:44:09.426485Z",
"url": "https://files.pythonhosted.org/packages/fa/71/1caf2a89cc2dcdb5b0aa645ecc30254f1fb70aaf7fc2404486485b38c23d/adafruit-circuitpython-debouncer-2.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-09 17:44:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adafruit",
"github_project": "Adafruit_CircuitPython_Debouncer",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "adafruit-circuitpython-debouncer"
}