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/90/ed/f286e7f717e22463bff4411902618b1447702ca081a59927ffd157f4f888/adafruit_circuitpython_magtag-2.2.11.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.11",
"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": "146d92b032b09889203b36bfde65d29652955201924400d2e9c3e77452e4a0d7",
"md5": "31facba425e905715f6c29e395aa1401",
"sha256": "7a2e0c534a849308b68fde6fa26eb5c96f97e9ce993d0e20c1cbe42ef985527f"
},
"downloads": -1,
"filename": "adafruit_circuitpython_magtag-2.2.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "31facba425e905715f6c29e395aa1401",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11044,
"upload_time": "2024-10-07T22:31:34",
"upload_time_iso_8601": "2024-10-07T22:31:34.682676Z",
"url": "https://files.pythonhosted.org/packages/14/6d/92b032b09889203b36bfde65d29652955201924400d2e9c3e77452e4a0d7/adafruit_circuitpython_magtag-2.2.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "90edf286e7f717e22463bff4411902618b1447702ca081a59927ffd157f4f888",
"md5": "ea9dbedb6a7e8ecb9730477c30b8f801",
"sha256": "a983d547635490a693f991740275453d9de7ffa1f32475d64e6b6dc067cc5c5f"
},
"downloads": -1,
"filename": "adafruit_circuitpython_magtag-2.2.11.tar.gz",
"has_sig": false,
"md5_digest": "ea9dbedb6a7e8ecb9730477c30b8f801",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 30332,
"upload_time": "2024-10-07T22:31:35",
"upload_time_iso_8601": "2024-10-07T22:31:35.624586Z",
"url": "https://files.pythonhosted.org/packages/90/ed/f286e7f717e22463bff4411902618b1447702ca081a59927ffd157f4f888/adafruit_circuitpython_magtag-2.2.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-07 22:31:35",
"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": [],
"lcname": "adafruit-circuitpython-magtag"
}