circuitpython-distox


Namecircuitpython-distox JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryDistoX Bluetooth Protocol
upload_time2023-06-14 21:18:08
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords adafruit blinka circuitpython micropython distox disto distox bluetooth cave survey
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============


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


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

DistoX Bluetooth Protocol - mimic the DistoX protocol for communicating with
paperless cave surveying tools e.g. `TopoDroid <https://github.com/marcocorvi/topodroid>`_ and
`SexyTopo <https://github.com/richsmith/sexytopo>`_


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

* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `Adafruit BLE <https://github.com/adafruit/Adafruit_CircuitPython_BLE>`_

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 from PyPI
====================

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

.. code-block:: shell

    pip3 install circuitpython-distox

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

.. code-block:: shell

    sudo pip3 install circuitpython-distox

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-distox

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 distox

Or the following command to update an existing version:

.. code-block:: shell

    circup update

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

.. code-block:: python

    import time

    import board
    import keypad
    from adafruit_ble import BLERadio
    from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
    import distox

    ble = BLERadio()
    ble.name = "DistoX"
    print(ble.name)
    disto = distox.DistoXService()
    disto_protocol = distox.SurveyProtocolService()
    advertisement = ProvideServicesAdvertisement(disto, disto_protocol)
    ble.start_advertising(advertisement)


    KEY_PINS = (board.D5, board.D9)
    keys = keypad.Keys(KEY_PINS, value_when_pressed=False, pull=True)

    compass = 0
    clino = 0
    distance = 5
    while True:
        event = keys.events.get()
        if event:
            key_number = event.key_number
            if event.pressed:
                if key_number == 0:
                    # change the values to send
                    compass = (compass + 10.5) % 360
                    clino += 5.5
                    if clino > 90:
                        clino -= 180
                    distance = (distance + 3.4) % 10000
                    print(compass, clino, distance)
                if key_number == 1:
                    disto.send_data(compass, clino, distance)
                    print("Data sent")
        message = disto.poll()
        if message:
            print(f"Message received: {message}")
        time.sleep(0.03)

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "circuitpython-distox",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "adafruit,blinka,circuitpython,micropython,distox,disto,distox,bluetooth,cave,survey",
    "author": "",
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/11/34/a5dd01eb86270edd79c35d74ebcfd95425549a94b391193d63b7585357e1/circuitpython-distox-1.0.0.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\n\n.. image:: https://readthedocs.org/projects/circuitpython-distox/badge/?version=latest\n    :target: https://circuitpython-distox.readthedocs.io/\n    :alt: Documentation Status\n\n\n.. image:: https://github.com/furbrain/CircuitPython_distox/workflows/Build%20CI/badge.svg\n    :target: https://github.com/furbrain/CircuitPython_distox/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\nDistoX Bluetooth Protocol - mimic the DistoX protocol for communicating with\npaperless cave surveying tools e.g. `TopoDroid <https://github.com/marcocorvi/topodroid>`_ and\n`SexyTopo <https://github.com/richsmith/sexytopo>`_\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n* `Adafruit BLE <https://github.com/adafruit/Adafruit_CircuitPython_BLE>`_\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\n\nInstalling from PyPI\n====================\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI <https://pypi.org/project/circuitpython-distox/>`_.\nTo install for current user:\n\n.. code-block:: shell\n\n    pip3 install circuitpython-distox\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install circuitpython-distox\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-distox\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 distox\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 time\n\n    import board\n    import keypad\n    from adafruit_ble import BLERadio\n    from adafruit_ble.advertising.standard import ProvideServicesAdvertisement\n    import distox\n\n    ble = BLERadio()\n    ble.name = \"DistoX\"\n    print(ble.name)\n    disto = distox.DistoXService()\n    disto_protocol = distox.SurveyProtocolService()\n    advertisement = ProvideServicesAdvertisement(disto, disto_protocol)\n    ble.start_advertising(advertisement)\n\n\n    KEY_PINS = (board.D5, board.D9)\n    keys = keypad.Keys(KEY_PINS, value_when_pressed=False, pull=True)\n\n    compass = 0\n    clino = 0\n    distance = 5\n    while True:\n        event = keys.events.get()\n        if event:\n            key_number = event.key_number\n            if event.pressed:\n                if key_number == 0:\n                    # change the values to send\n                    compass = (compass + 10.5) % 360\n                    clino += 5.5\n                    if clino > 90:\n                        clino -= 180\n                    distance = (distance + 3.4) % 10000\n                    print(compass, clino, distance)\n                if key_number == 1:\n                    disto.send_data(compass, clino, distance)\n                    print(\"Data sent\")\n        message = disto.poll()\n        if message:\n            print(f\"Message received: {message}\")\n        time.sleep(0.03)\n\nDocumentation\n=============\nAPI documentation for this library can be found on `Read the Docs <https://circuitpython-distox.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_distox/blob/HEAD/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "DistoX Bluetooth Protocol",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/furbrain/CircuitPython_distox"
    },
    "split_keywords": [
        "adafruit",
        "blinka",
        "circuitpython",
        "micropython",
        "distox",
        "disto",
        "distox",
        "bluetooth",
        "cave",
        "survey"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33f603256de5e3ea6104d9d87855264ec99127782fcd016ed29765525a5f6ceb",
                "md5": "32ff3606c648577bde5f3b1ed5828673",
                "sha256": "1eefe52f05e4d0100d62a11ef9ff7eaa0f278f28ed09f2ea3c8ece999ad917e8"
            },
            "downloads": -1,
            "filename": "circuitpython_distox-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "32ff3606c648577bde5f3b1ed5828673",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6744,
            "upload_time": "2023-06-14T21:18:06",
            "upload_time_iso_8601": "2023-06-14T21:18:06.904790Z",
            "url": "https://files.pythonhosted.org/packages/33/f6/03256de5e3ea6104d9d87855264ec99127782fcd016ed29765525a5f6ceb/circuitpython_distox-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1134a5dd01eb86270edd79c35d74ebcfd95425549a94b391193d63b7585357e1",
                "md5": "f89d642eff81c41d2ea75da06d431e16",
                "sha256": "ef2899a98072615610339879fe07404fc3f060d203f5623b90ce5517ef1fb424"
            },
            "downloads": -1,
            "filename": "circuitpython-distox-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f89d642eff81c41d2ea75da06d431e16",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 28361,
            "upload_time": "2023-06-14T21:18:08",
            "upload_time_iso_8601": "2023-06-14T21:18:08.394063Z",
            "url": "https://files.pythonhosted.org/packages/11/34/a5dd01eb86270edd79c35d74ebcfd95425549a94b391193d63b7585357e1/circuitpython-distox-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-14 21:18:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "furbrain",
    "github_project": "CircuitPython_distox",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "circuitpython-distox"
}
        
Elapsed time: 0.13469s