circuitpython-async-buzzer


Namecircuitpython-async-buzzer JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryPlay simple tunes on a piezo buzzer asynchronously
upload_time2023-04-09 13:10:55
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords adafruit blinka circuitpython micropython async_buzzer asyncio buzzer piezo music tune alert async asynchronous
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============


.. image:: https://readthedocs.org/projects/circuitpython-async-buzzer/badge/?version=latest
    :target: https://circuitpython-async-buzzer.readthedocs.io/
    :alt: Documentation Status



.. image:: https://img.shields.io/discord/327254708534116352.svg
    :target: https://adafru.it/discord
    :alt: Discord


.. image:: https://github.com/furbrain/CircuitPython_async_buzzer/workflows/Build%20CI/badge.svg
    :target: https://github.com/furbrain/CircuitPython_async_buzzer/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

Play simple tunes on a piezo buzzer asynchronously


Dependencies
=============
This driver depends on:

* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `CircuitPython asyncio module <https://github.com/adafruit/Adafruit_CircuitPython_asyncio>`_

Installing from PyPI
=====================
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/circuitpython-async-buzzer/>`_.
To install for current user:

.. code-block:: shell

    pip3 install circuitpython-async-buzzer

To install system-wide (this may be required in some cases):

.. code-block:: shell

    sudo pip3 install circuitpython-async-buzzer

To install in a virtual environment in your current project:

.. code-block:: shell

    mkdir project-name && cd project-name
    python3 -m venv .venv
    source .env/bin/activate
    pip3 install circuitpython-async-buzzer

Installing to a Connected CircuitPython Device with Circup
==========================================================

Make sure that you have ``circup`` installed in your Python environment.
Install it with the following command if necessary:

.. code-block:: shell

    pip3 install circup

With ``circup`` installed and your CircuitPython device connected use the
following command to install:

.. code-block:: shell

    circup install async_buzzer

Or the following command to update an existing version:

.. code-block:: shell

    circup update

Usage Example
=============

.. code-block:: python

    import asyncio

    import pwmio

    from async_buzzer import Buzzer
    import board

    tune = [
        ("E5",500),
        ("G5",500),
        ("A5",1000),
        ("E5",500),
        ("G5",500),
        ("B5",250),
        ("A5",750),
        ("E5",500),
        ("G5",500),
        ("A5",1000),
        ("G5",500),
        ("E5",1500)
    ]

    pwm = pwmio.PWMOut(board.D10, variable_frequency=True)
    buzzer = Buzzer(pwm)


    async def main():
        buzzer.play(tune, wait=False)
        for i in range(5):
            print(i)
            await asyncio.sleep(1)
        await buzzer.wait()

    asyncio.run(main())

Documentation
=============
API documentation for this library can be found on `Read the Docs <https://circuitpython-async-buzzer.readthedocs.io/>`_.

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/furbrain/CircuitPython_async_buzzer/blob/HEAD/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "circuitpython-async-buzzer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adafruit,blinka,circuitpython,micropython,async_buzzer,asyncio,buzzer,piezo,music,tune,alert,async,asynchronous",
    "author": "",
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/dd/61/065ca0a6f1e7e1364fbaaa7020ec85d3cf30118eb6dc225352c7193e1980/circuitpython-async-buzzer-1.0.1.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\n\n.. image:: https://readthedocs.org/projects/circuitpython-async-buzzer/badge/?version=latest\n    :target: https://circuitpython-async-buzzer.readthedocs.io/\n    :alt: Documentation Status\n\n\n\n.. image:: https://img.shields.io/discord/327254708534116352.svg\n    :target: https://adafru.it/discord\n    :alt: Discord\n\n\n.. image:: https://github.com/furbrain/CircuitPython_async_buzzer/workflows/Build%20CI/badge.svg\n    :target: https://github.com/furbrain/CircuitPython_async_buzzer/actions\n    :alt: Build Status\n\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\nPlay simple tunes on a piezo buzzer asynchronously\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n* `CircuitPython asyncio module <https://github.com/adafruit/Adafruit_CircuitPython_asyncio>`_\n\nInstalling from PyPI\n=====================\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI <https://pypi.org/project/circuitpython-async-buzzer/>`_.\nTo install for current user:\n\n.. code-block:: shell\n\n    pip3 install circuitpython-async-buzzer\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install circuitpython-async-buzzer\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n    mkdir project-name && cd project-name\n    python3 -m venv .venv\n    source .env/bin/activate\n    pip3 install circuitpython-async-buzzer\n\nInstalling to a Connected CircuitPython Device with Circup\n==========================================================\n\nMake sure that you have ``circup`` installed in your Python environment.\nInstall it with the following command if necessary:\n\n.. code-block:: shell\n\n    pip3 install circup\n\nWith ``circup`` installed and your CircuitPython device connected use the\nfollowing command to install:\n\n.. code-block:: shell\n\n    circup install async_buzzer\n\nOr the following command to update an existing version:\n\n.. code-block:: shell\n\n    circup update\n\nUsage Example\n=============\n\n.. code-block:: python\n\n    import asyncio\n\n    import pwmio\n\n    from async_buzzer import Buzzer\n    import board\n\n    tune = [\n        (\"E5\",500),\n        (\"G5\",500),\n        (\"A5\",1000),\n        (\"E5\",500),\n        (\"G5\",500),\n        (\"B5\",250),\n        (\"A5\",750),\n        (\"E5\",500),\n        (\"G5\",500),\n        (\"A5\",1000),\n        (\"G5\",500),\n        (\"E5\",1500)\n    ]\n\n    pwm = pwmio.PWMOut(board.D10, variable_frequency=True)\n    buzzer = Buzzer(pwm)\n\n\n    async def main():\n        buzzer.play(tune, wait=False)\n        for i in range(5):\n            print(i)\n            await asyncio.sleep(1)\n        await buzzer.wait()\n\n    asyncio.run(main())\n\nDocumentation\n=============\nAPI documentation for this library can be found on `Read the Docs <https://circuitpython-async-buzzer.readthedocs.io/>`_.\n\nFor information on building library documentation, please check out\n`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/furbrain/CircuitPython_async_buzzer/blob/HEAD/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Play simple tunes on a piezo buzzer asynchronously",
    "version": "1.0.1",
    "split_keywords": [
        "adafruit",
        "blinka",
        "circuitpython",
        "micropython",
        "async_buzzer",
        "asyncio",
        "buzzer",
        "piezo",
        "music",
        "tune",
        "alert",
        "async",
        "asynchronous"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "34cd9e9ce8a706fabb7f53f025db58c18dc6c3617cb8163d52cd4fee8c04337b",
                "md5": "d5561e6ce5bd8f13b5ffb59eb06de0f7",
                "sha256": "ed173f5239147fe9f051a8a17b437f4ba6722e3d7e60a7b0fbcb742a3bf093d7"
            },
            "downloads": -1,
            "filename": "circuitpython_async_buzzer-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d5561e6ce5bd8f13b5ffb59eb06de0f7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5391,
            "upload_time": "2023-04-09T13:10:53",
            "upload_time_iso_8601": "2023-04-09T13:10:53.470873Z",
            "url": "https://files.pythonhosted.org/packages/34/cd/9e9ce8a706fabb7f53f025db58c18dc6c3617cb8163d52cd4fee8c04337b/circuitpython_async_buzzer-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dd61065ca0a6f1e7e1364fbaaa7020ec85d3cf30118eb6dc225352c7193e1980",
                "md5": "389437f2a07fbba8fe442b31044b3a2d",
                "sha256": "ca47d64d08c500ae5640c026317f7d57aeba0874bedac3f596a8ee0740d5d708"
            },
            "downloads": -1,
            "filename": "circuitpython-async-buzzer-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "389437f2a07fbba8fe442b31044b3a2d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 26727,
            "upload_time": "2023-04-09T13:10:55",
            "upload_time_iso_8601": "2023-04-09T13:10:55.483145Z",
            "url": "https://files.pythonhosted.org/packages/dd/61/065ca0a6f1e7e1364fbaaa7020ec85d3cf30118eb6dc225352c7193e1980/circuitpython-async-buzzer-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-09 13:10:55",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "circuitpython-async-buzzer"
}
        
Elapsed time: 1.00434s