{"id":14954336,"url":"https://github.com/jandelgado/jled-circuitpython","last_synced_at":"2025-10-29T22:31:19.784Z","repository":{"id":65188841,"uuid":"544564291","full_name":"jandelgado/jled-circuitpython","owner":"jandelgado","description":"Non-blocking LED controlling library for CirctuitPython and MicroPython.","archived":false,"fork":false,"pushed_at":"2023-06-29T20:00:51.000Z","size":5902,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T05:31:29.059Z","etag":null,"topics":["circuitpython","jled","micropython"],"latest_commit_sha":null,"homepage":"https://jandelgado.github.io/jled-circuitpython","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jandelgado.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-02T19:42:19.000Z","updated_at":"2024-12-01T13:17:04.000Z","dependencies_parsed_at":"2024-10-12T03:21:14.706Z","dependency_job_id":"7991f431-bc13-4bd7-871a-ae308600cf6c","html_url":"https://github.com/jandelgado/jled-circuitpython","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.4,"last_synced_commit":"b2ed156222759fcb92fca9cb4125e8d0e376bfeb"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fjled-circuitpython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fjled-circuitpython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fjled-circuitpython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jandelgado%2Fjled-circuitpython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jandelgado","download_url":"https://codeload.github.com/jandelgado/jled-circuitpython/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238909321,"owners_count":19550837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circuitpython","jled","micropython"],"created_at":"2024-09-24T13:01:51.563Z","updated_at":"2025-10-29T22:31:19.777Z","avatar_url":"https://github.com/jandelgado.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\n\n.. image:: https://github.com/jandelgado/jled-circuitpython/workflows/Build%20CI/badge.svg\n    :target: https://github.com/jandelgado/jled-circuitpython/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\n.. image:: https://img.shields.io/badge/-API%20documentation-brightgreen\n    :target: https://jandelgado.github.io/jled-circuitpython\n    :alt: API Documentation\n\nAn embedded library for Python to control LEDs. It uses a **non-blocking**\napproach and can control LEDs in simple (**on**/**off**) and complex\n(**blinking**, **breathing** and more) ways in a **time-driven** manner.\n\nThis is a pure Python port of my `JLed \u003chttps://github.com/jandelgado/jled\u003e`_\nC++ library.\n\n.. image:: .images/jled.gif\n    :alt: JLed in action\n\nFeatures\n========\n\n- non-blocking\n- effects: simple on/off, breathe, blink, candle, fade, user-defined\n- supports inverted  polarity of LED\n- easy configuration using fluent interface\n- can control groups of LEDs sequentially or in parallel\n- supports CircuitPython and MicroPython\n\nUsage Example\n=============\n\nTest JLed interactively in a CircuitPython REPL:\n\n.. code-block::\n\n  Adafruit CircuitPython 7.3.3 on 2022-08-29; Raspberry Pi Pico with rp2040\n  \u003e\u003e\u003e import board\n  \u003e\u003e\u003e from jled import JLed\n  \u003e\u003e\u003e led=JLed(board.LED).breathe(500).delay_after(250).repeat(5)\n  \u003e\u003e\u003e while led.update(): pass\n\nThis creates a JLed object connected to the builtin LED (``board.LED``), with a\nbreathe effect that is repeated 5 times.  Each iteration is followed by a delay\nof 250 ms, before starting again.  By calling ``led.update()`` periodically,\nthe LED gets physically updated. Alternatively ``play(led)`` can be call in the\nREPL as a shortcut.  Once finished, call ``led.reset()`` before playing the\neffect again.\n\nCheat Sheet\n===========\n\n.. image:: .images/jled_cheat_sheet.jpg\n\nInstallation\n=============\n\nOn supported GNU/Linux systems like the Raspberry Pi (with `Adafruit-Blinka\n\u003chttps://pypi.org/project/Adafruit-Blinka/\u003e`_), you can install the lib\nlocally `from PyPI \u003chttps://pypi.org/project/circuitpython-jled/\u003e`_.  To\ninstall for current user:\n\n.. code-block:: shell\n\n    pip3 install circuitpython-jled\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install circuitpython-jled\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n    mkdir project-name \u0026\u0026 cd project-name\n    python3 -m venv .venv\n    source .env/bin/activate\n    pip3 install circuitpython-jled\n\nInstalling to a Connected CircuitPython Device with Circup\n----------------------------------------------------------\n\n``JLed`` is available in the `Circuitpython Community Bundle \u003chttps://github.com/adafruit/CircuitPython_Community_Bundle\u003e`_\nand can easily installed with `circup \u003chttps://pypi.org/project/circup/\u003e`_ by\nrunning::\n\n    $ circup install jled\n\nOptionally copy also one of the example as ``code.py`` to the root of the filesystem.\n\nInstalling on a MicroPython device\n----------------------------------\n\nCreate a directory called ``jled`` on the device and `copy\n\u003chttps://pypi.org/project/mpremote/\u003e`_ the following files into this directory:\n``jled.py``, ``jled_sequence.py`` ``hal_pwm_micropython.py``,\n``hal_time_micropython.py``, ``play.py``, ``__init__.py```. Optionally also copy\none of the example as ``main.py`` to the root of the filesystem.  The overall\nstructure is:\n\n.. code-block::\n\n   /\n   ├─ main.py\n   └─ jled\n       ├─ __init__.[m]py\n       ├─ hal_pwm_micropython.[m]py\n       ├─ hal_time_micropython.[m]py\n       ├─ jled.[m]py\n       ├─ jled_sequence.[m]py\n       └─ play.[m]py\n\nTo reduce memory consumption, Python source files can be compiled to binary\n``mpy`` format using the `mpy-cross \u003chttps://pypi.org/project/mpy-cross/\u003e`_\ntool. For convenience, a script to compile and copy jled to a connected device\nis provided here (see ``scripts/install_mp.sh``).\n\nDocumentation\n=============\n\n`API documentation for this library can be found on here\n\u003chttps://jandelgado.github.io/jled-circuitpython/\u003e`_.\n\nRebuild the documentation with ``sphinx-build -E -W -b html . _build/html``\nin the ``docs`` directory. Run ``pip install \".[optional]\"`` before to install\nbuild-time dependency `Sphinx \u003chttps://www.sphinx-doc.org/\u003e`_\n\nTests\n=====\n\nUnit tests (using https://docs.pytest.org) are provided, run the tests with:\n\n.. code-block::\n\n   $ pip install \".[optional]\"\n   $ pytest\n\nTo run the ``pre-commit-hook`` locally, run ``pre-commit run --all-files``\n\nTip\n===\n\nInstead of installing the various tools like ``circup``, ``mp-remote``,\n``mpy-cross`` etc. you can easily run the tools using `uv \u003chttps://docs.astral.sh/uv/\u003e`_:\n\n- ``uv tool run circup list``, ``uv tool run circup update --all``\n- ``uv tool run mpremote`` to start a REPL on the micro controller\n- ``uv tool run --with pytest-cov pytest`` to run the unit tests\n- ``uv tool run --from sphinx sphinx-build -E -W -b html . build/html`` to build\n  the documentation using sphinx (run inside ``docs/``)\n\n\nAuthor \u0026 Copyright\n==================\n\nCopyright © 2022-2023 by Jan Delgado, License: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandelgado%2Fjled-circuitpython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjandelgado%2Fjled-circuitpython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjandelgado%2Fjled-circuitpython/lists"}