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/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff
:alt: Code Style: Ruff
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/75/72/82e4274b1879a9d3772cfbf47c975fc5891dde50b1d60fc380c717debe67/adafruit_circuitpython_magtag-2.2.16.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/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n :target: https://github.com/astral-sh/ruff\n :alt: Code Style: Ruff\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.16",
"project_urls": {
"Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_MagTag"
},
"split_keywords": [
"adafruit",
" magtag",
" eink",
" iot",
" esp32",
" espressif",
" hardware",
" micropythoncircuitpython"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d856965814bac8e47220b2a03a81fd6767cd88d34fdc18b51729ade3a27d4019",
"md5": "866d538a3355a3fe7b0d9e846d1cfbbf",
"sha256": "d67a2d51e19f8c8f53301b47c840155e82a0ddf83737e49ec5b63aaf27b0e325"
},
"downloads": -1,
"filename": "adafruit_circuitpython_magtag-2.2.16-py3-none-any.whl",
"has_sig": false,
"md5_digest": "866d538a3355a3fe7b0d9e846d1cfbbf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10811,
"upload_time": "2025-10-20T20:47:12",
"upload_time_iso_8601": "2025-10-20T20:47:12.328588Z",
"url": "https://files.pythonhosted.org/packages/d8/56/965814bac8e47220b2a03a81fd6767cd88d34fdc18b51729ade3a27d4019/adafruit_circuitpython_magtag-2.2.16-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "757282e4274b1879a9d3772cfbf47c975fc5891dde50b1d60fc380c717debe67",
"md5": "d96bc0706a385f582d6afdd28443b66c",
"sha256": "63fcec8e5da4451bf48b5634a43a0cc462fba5e297dcb3a284119032afc2d93f"
},
"downloads": -1,
"filename": "adafruit_circuitpython_magtag-2.2.16.tar.gz",
"has_sig": false,
"md5_digest": "d96bc0706a385f582d6afdd28443b66c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 27017,
"upload_time": "2025-10-20T20:47:13",
"upload_time_iso_8601": "2025-10-20T20:47:13.357686Z",
"url": "https://files.pythonhosted.org/packages/75/72/82e4274b1879a9d3772cfbf47c975fc5891dde50b1d60fc380c717debe67/adafruit_circuitpython_magtag-2.2.16.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-20 20:47:13",
"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"
}