adafruit-circuitpython-debouncer


Nameadafruit-circuitpython-debouncer JSON
Version 2.0.10 PyPI version JSON
download
home_pageNone
SummaryCircuitPython pin or arbitrary predicate debouncer.
upload_time2025-01-16 19:43:22
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT
keywords adafruit blinka circuitpython micropython debouncer debounce
VCS
bugtrack_url
requirements Adafruit-Blinka adafruit-circuitpython-ticks
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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": null,
    "name": "adafruit-circuitpython-debouncer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "adafruit, blinka, circuitpython, micropython, debouncer, debounce",
    "author": null,
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/61/4d/164ea0dde16fb1b06495f78f9bfd18ab3f46c01af05a9835a9874843c084/adafruit_circuitpython_debouncer-2.0.10.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.10",
    "project_urls": {
        "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_Debouncer"
    },
    "split_keywords": [
        "adafruit",
        " blinka",
        " circuitpython",
        " micropython",
        " debouncer",
        " debounce"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cc99357d1fab7e2914119802dbf621998322396e97a454e25ea65604c26e6eea",
                "md5": "c6e8b1f0f565df5a4fbec7f4cc81a9f4",
                "sha256": "2e73143949d7ae97e8dcd07953473323da2c0c0af1ef2bff249fe83cb81cac10"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_debouncer-2.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c6e8b1f0f565df5a4fbec7f4cc81a9f4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5720,
            "upload_time": "2025-01-16T19:43:21",
            "upload_time_iso_8601": "2025-01-16T19:43:21.617923Z",
            "url": "https://files.pythonhosted.org/packages/cc/99/357d1fab7e2914119802dbf621998322396e97a454e25ea65604c26e6eea/adafruit_circuitpython_debouncer-2.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "614d164ea0dde16fb1b06495f78f9bfd18ab3f46c01af05a9835a9874843c084",
                "md5": "c32330ea8dc2309f9e2eaf0dc6f2949a",
                "sha256": "af903ebd6918b668d5ace55afae6c335fda88dcdff112906252311c6a5853d7d"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_debouncer-2.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "c32330ea8dc2309f9e2eaf0dc6f2949a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 28907,
            "upload_time": "2025-01-16T19:43:22",
            "upload_time_iso_8601": "2025-01-16T19:43:22.579229Z",
            "url": "https://files.pythonhosted.org/packages/61/4d/164ea0dde16fb1b06495f78f9bfd18ab3f46c01af05a9835a9874843c084/adafruit_circuitpython_debouncer-2.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-16 19:43:22",
    "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": [
        {
            "name": "Adafruit-Blinka",
            "specs": []
        },
        {
            "name": "adafruit-circuitpython-ticks",
            "specs": []
        }
    ],
    "lcname": "adafruit-circuitpython-debouncer"
}
        
Elapsed time: 0.81443s