circuitpython-seeed-xiao-nrf52840


Namecircuitpython-seeed-xiao-nrf52840 JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryProvides access to onboard sensors and battet
upload_time2022-12-03 18:27:39
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords adafruit blinka circuitpython micropython seeed_xiao_nrf52840 seeed xiao nrf52840 accelerometer microphone battery
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============




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


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

Provides access to onboard sensors and battet


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

* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `Adafruit's LSM6DS library: <https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS>`_

Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_
or individual libraries can be installed using
`circup <https://github.com/adafruit/circup>`_.

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 seeed_xiao_nrf52840

Or the following command to update an existing version:

.. code-block:: shell

    circup update

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


.. code-block:: python

    import array
    import time

    import audiocore
    import audiopwmio
    import board

    from seeed_xiao_nrf52840 import IMU, Mic, Battery

    with Battery() as bat:
        print(f"Charge_status: {bat.charge_status}")
        print(f"Voltage: {bat.voltage}")
        print(f"Charge_current high?: {bat.charge_current}")
        print("Setting charge current to high")
        bat.charge_current = bat.CHARGE_100MA
        print(f"Charge_current high?: {bat.charge_current}")

    with IMU() as imu:
        for i in range(5):
            print("Acceleration:", imu.acceleration)
            time.sleep(1)

    with Mic() as mic:
        for i in range(5):
            print(f"Start speaking in: {5-i}")
            time.sleep(1)
        b = array.array("H")
        for i in range(8000):
            b.append(0)
        print("SPEAK!!!")
        mic.record(b, len(b))
        print(b)
        for i in range(5):
            print(f"Replaying in: {5-i}")
            time.sleep(1)
        with audiopwmio.PWMAudioOut(board.D0) as aud:
            print("PWM setup")
            sample = audiocore.RawSample(b, sample_rate=8000)
            print("sample ready")
            aud.play(sample,loop=True)
            print("playing")
            time.sleep(5)
            aud.stop()

Documentation
=============
API documentation for this library can be found on `Read the Docs <https://circuitpython-seeed-xiao-nrf52840.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_seeed_xiao_nRF52840/blob/HEAD/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "circuitpython-seeed-xiao-nrf52840",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adafruit,blinka,circuitpython,micropython,seeed_xiao_nrf52840,seeed,xiao,nrf52840,accelerometer,microphone,battery",
    "author": "",
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/e5/c7/c75b5ebdeac8b87d191c9c33852ae19e8054008f25169992e30affc8702b/circuitpython-seeed-xiao-nrf52840-1.0.1.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\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_seeed_xiao_nRF52840/workflows/Build%20CI/badge.svg\n    :target: https://github.com/furbrain/CircuitPython_seeed_xiao_nRF52840/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\nProvides access to onboard sensors and battet\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n* `Adafruit's LSM6DS library: <https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS>`_\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://circuitpython.org/libraries>`_\nor individual libraries can be installed using\n`circup <https://github.com/adafruit/circup>`_.\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 seeed_xiao_nrf52840\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\n.. code-block:: python\n\n    import array\n    import time\n\n    import audiocore\n    import audiopwmio\n    import board\n\n    from seeed_xiao_nrf52840 import IMU, Mic, Battery\n\n    with Battery() as bat:\n        print(f\"Charge_status: {bat.charge_status}\")\n        print(f\"Voltage: {bat.voltage}\")\n        print(f\"Charge_current high?: {bat.charge_current}\")\n        print(\"Setting charge current to high\")\n        bat.charge_current = bat.CHARGE_100MA\n        print(f\"Charge_current high?: {bat.charge_current}\")\n\n    with IMU() as imu:\n        for i in range(5):\n            print(\"Acceleration:\", imu.acceleration)\n            time.sleep(1)\n\n    with Mic() as mic:\n        for i in range(5):\n            print(f\"Start speaking in: {5-i}\")\n            time.sleep(1)\n        b = array.array(\"H\")\n        for i in range(8000):\n            b.append(0)\n        print(\"SPEAK!!!\")\n        mic.record(b, len(b))\n        print(b)\n        for i in range(5):\n            print(f\"Replaying in: {5-i}\")\n            time.sleep(1)\n        with audiopwmio.PWMAudioOut(board.D0) as aud:\n            print(\"PWM setup\")\n            sample = audiocore.RawSample(b, sample_rate=8000)\n            print(\"sample ready\")\n            aud.play(sample,loop=True)\n            print(\"playing\")\n            time.sleep(5)\n            aud.stop()\n\nDocumentation\n=============\nAPI documentation for this library can be found on `Read the Docs <https://circuitpython-seeed-xiao-nrf52840.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_seeed_xiao_nRF52840/blob/HEAD/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Provides access to onboard sensors and battet",
    "version": "1.0.1",
    "split_keywords": [
        "adafruit",
        "blinka",
        "circuitpython",
        "micropython",
        "seeed_xiao_nrf52840",
        "seeed",
        "xiao",
        "nrf52840",
        "accelerometer",
        "microphone",
        "battery"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "bbe703d8e13e3454f93251747b66a4a1",
                "sha256": "a17946782a202a6e3bc1577d1b6632bb01302c97fe77ff47d1622f808a3970a4"
            },
            "downloads": -1,
            "filename": "circuitpython_seeed_xiao_nrf52840-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bbe703d8e13e3454f93251747b66a4a1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6449,
            "upload_time": "2022-12-03T18:27:37",
            "upload_time_iso_8601": "2022-12-03T18:27:37.523510Z",
            "url": "https://files.pythonhosted.org/packages/5b/a2/73673aaaaf30f8a9af1008256ee63a3d45d1b091c2238c5edf4ed4e27170/circuitpython_seeed_xiao_nrf52840-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "d2d67bb0eae41c7fd55c52cf930b4cab",
                "sha256": "5da70d0e9b3fa82ba0203a3d90ad108c7f0bf2fefcadf36d37e7084970432c08"
            },
            "downloads": -1,
            "filename": "circuitpython-seeed-xiao-nrf52840-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d2d67bb0eae41c7fd55c52cf930b4cab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 29376,
            "upload_time": "2022-12-03T18:27:39",
            "upload_time_iso_8601": "2022-12-03T18:27:39.128425Z",
            "url": "https://files.pythonhosted.org/packages/e5/c7/c75b5ebdeac8b87d191c9c33852ae19e8054008f25169992e30affc8702b/circuitpython-seeed-xiao-nrf52840-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-03 18:27:39",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "circuitpython-seeed-xiao-nrf52840"
}
        
Elapsed time: 0.01992s