adafruit-circuitpython-magtag


Nameadafruit-circuitpython-magtag JSON
Version 2.2.10 PyPI version JSON
download
home_pageNone
SummaryHelper library for the Adafruit MagTag
upload_time2024-04-01 14:54:38
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT
keywords adafruit magtag eink iot esp32 espressif hardware micropythoncircuitpython
VCS
bugtrack_url
requirements Adafruit-Blinka-displayio Adafruit-Blinka adafruit-circuitpython-requests adafruit-circuitpython-neopixel adafruit-circuitpython-simpleio adafruit-circuitpython-portalbase
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============

.. image:: https://readthedocs.org/projects/adafruit-circuitpython-magtag/badge/?version=latest
    :target: https://docs.circuitpython.org/projects/magtag/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_MagTag/workflows/Build%20CI/badge.svg
    :target: https://github.com/adafruit/Adafruit_CircuitPython_MagTag/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

Helper library for the Adafruit MagTag.


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

* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `Adafruit PortalBase <https://github.com/adafruit/Adafruit_CircuitPython_PortalBase>`_

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>`_.


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

.. code:: python

    # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
    #
    # SPDX-License-Identifier: Unlicense
    import time
    import terminalio
    from adafruit_magtag.magtag import MagTag

    magtag = MagTag()

    magtag.add_text(
        text_font=terminalio.FONT,
        text_position=(
            50,
            (magtag.graphics.display.height // 2) - 1,
        ),
        text_scale=3,
    )

    magtag.set_text("Hello World")

    buttons = magtag.peripherals.buttons
    button_colors = ((255, 0, 0), (255, 150, 0), (0, 255, 255), (180, 0, 255))
    button_tones = (1047, 1318, 1568, 2093)
    timestamp = time.monotonic()

    while True:
        for i, b in enumerate(buttons):
            if not b.value:
                print("Button %c pressed" % chr((ord("A") + i)))
                magtag.peripherals.neopixel_disable = False
                magtag.peripherals.neopixels.fill(button_colors[i])
                magtag.peripherals.play_tone(button_tones[i], 0.25)
                break
        else:
            magtag.peripherals.neopixel_disable = True
        time.sleep(0.01)


Documentation
=============

API documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/magtag/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_MagTag/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "adafruit-circuitpython-magtag",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "adafruit, magtag, eink, iot, esp32, espressif, hardware, micropythoncircuitpython",
    "author": null,
    "author_email": "Adafruit Industries <circuitpython@adafruit.com>",
    "download_url": "https://files.pythonhosted.org/packages/26/26/7d2aa6524d1a77d7e4602c812756eb6233d795e06a45a41a1f370e4b8860/adafruit-circuitpython-magtag-2.2.10.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-magtag/badge/?version=latest\n    :target: https://docs.circuitpython.org/projects/magtag/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_MagTag/workflows/Build%20CI/badge.svg\n    :target: https://github.com/adafruit/Adafruit_CircuitPython_MagTag/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\nHelper library for the Adafruit MagTag.\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n* `Adafruit PortalBase <https://github.com/adafruit/Adafruit_CircuitPython_PortalBase>`_\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>`_.\n\n\nUsage Example\n=============\n\n.. code:: python\n\n    # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries\n    #\n    # SPDX-License-Identifier: Unlicense\n    import time\n    import terminalio\n    from adafruit_magtag.magtag import MagTag\n\n    magtag = MagTag()\n\n    magtag.add_text(\n        text_font=terminalio.FONT,\n        text_position=(\n            50,\n            (magtag.graphics.display.height // 2) - 1,\n        ),\n        text_scale=3,\n    )\n\n    magtag.set_text(\"Hello World\")\n\n    buttons = magtag.peripherals.buttons\n    button_colors = ((255, 0, 0), (255, 150, 0), (0, 255, 255), (180, 0, 255))\n    button_tones = (1047, 1318, 1568, 2093)\n    timestamp = time.monotonic()\n\n    while True:\n        for i, b in enumerate(buttons):\n            if not b.value:\n                print(\"Button %c pressed\" % chr((ord(\"A\") + i)))\n                magtag.peripherals.neopixel_disable = False\n                magtag.peripherals.neopixels.fill(button_colors[i])\n                magtag.peripherals.play_tone(button_tones[i], 0.25)\n                break\n        else:\n            magtag.peripherals.neopixel_disable = True\n        time.sleep(0.01)\n\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/magtag/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_MagTag/blob/master/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Helper library for the Adafruit MagTag",
    "version": "2.2.10",
    "project_urls": {
        "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_MagTag"
    },
    "split_keywords": [
        "adafruit",
        " magtag",
        " eink",
        " iot",
        " esp32",
        " espressif",
        " hardware",
        " micropythoncircuitpython"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac2f58430228b35806f17526c2d9207a7f2b96840baef1e737f4d13ea1bb95fc",
                "md5": "f7c48b34fe79c3fc4f26c340c22f1e24",
                "sha256": "61ae8d8893f75f0cf3deb919b27a619d085350f151974ea0009bf63222ba43f6"
            },
            "downloads": -1,
            "filename": "adafruit_circuitpython_magtag-2.2.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f7c48b34fe79c3fc4f26c340c22f1e24",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 11044,
            "upload_time": "2024-04-01T14:54:37",
            "upload_time_iso_8601": "2024-04-01T14:54:37.321684Z",
            "url": "https://files.pythonhosted.org/packages/ac/2f/58430228b35806f17526c2d9207a7f2b96840baef1e737f4d13ea1bb95fc/adafruit_circuitpython_magtag-2.2.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "26267d2aa6524d1a77d7e4602c812756eb6233d795e06a45a41a1f370e4b8860",
                "md5": "181f814d5d7b454fb7dda089b09f1bcc",
                "sha256": "bbfd3e086ba42ec38e3995b626f4478c398eea38c66bd1cbe84b2b1e0552166e"
            },
            "downloads": -1,
            "filename": "adafruit-circuitpython-magtag-2.2.10.tar.gz",
            "has_sig": false,
            "md5_digest": "181f814d5d7b454fb7dda089b09f1bcc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 30329,
            "upload_time": "2024-04-01T14:54:38",
            "upload_time_iso_8601": "2024-04-01T14:54:38.558507Z",
            "url": "https://files.pythonhosted.org/packages/26/26/7d2aa6524d1a77d7e4602c812756eb6233d795e06a45a41a1f370e4b8860/adafruit-circuitpython-magtag-2.2.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-01 14:54:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adafruit",
    "github_project": "Adafruit_CircuitPython_MagTag",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "Adafruit-Blinka-displayio",
            "specs": []
        },
        {
            "name": "Adafruit-Blinka",
            "specs": []
        },
        {
            "name": "adafruit-circuitpython-requests",
            "specs": []
        },
        {
            "name": "adafruit-circuitpython-neopixel",
            "specs": []
        },
        {
            "name": "adafruit-circuitpython-simpleio",
            "specs": []
        },
        {
            "name": "adafruit-circuitpython-portalbase",
            "specs": []
        }
    ],
    "lcname": "adafruit-circuitpython-magtag"
}
        
Elapsed time: 0.27251s