{"id":15290589,"url":"https://github.com/soldag/python-pwmled","last_synced_at":"2025-07-28T07:10:11.787Z","repository":{"id":16226022,"uuid":"79567916","full_name":"soldag/python-pwmled","owner":"soldag","description":"Control LEDs connected to a micro controller using pulse-width modulation.","archived":false,"fork":false,"pushed_at":"2023-10-12T23:06:49.000Z","size":65,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-17T09:52:38.613Z","etag":null,"topics":["led","pca9685","pwm","raspberry-pi"],"latest_commit_sha":null,"homepage":"","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/soldag.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null}},"created_at":"2017-01-20T14:55:50.000Z","updated_at":"2024-12-04T00:02:00.000Z","dependencies_parsed_at":"2025-04-13T10:28:55.733Z","dependency_job_id":"4356157c-a575-4f34-a174-48e8a91a266f","html_url":"https://github.com/soldag/python-pwmled","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/soldag/python-pwmled","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldag%2Fpython-pwmled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldag%2Fpython-pwmled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldag%2Fpython-pwmled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldag%2Fpython-pwmled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soldag","download_url":"https://codeload.github.com/soldag/python-pwmled/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldag%2Fpython-pwmled/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266481732,"owners_count":23935938,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["led","pca9685","pwm","raspberry-pi"],"created_at":"2024-09-30T16:08:42.905Z","updated_at":"2025-07-28T07:10:11.702Z","avatar_url":"https://github.com/soldag.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-pwmled [![PyPI version](https://badge.fury.io/py/pwmled.svg)](https://badge.fury.io/py/pwmled)\n\n`python-pwmled` controls LEDs connected to a micro controller using pulse-width modulation. It supports one-color, RGB and RGBW leds driven by GPIOs of an Raspberry Pi or a PCA9685 controller.\n\n# Installation\n`python-pwmled` requires Python 3. It can be installed using pip:\n```bash\npip install pwmled\n```\n\nWhen directly controlling the GPIOs of a Raspberry Pi using the `GpioDriver`(see [below](#configuration)), the [pigpio C library](https://github.com/joan2937/pigpio) is required. It can be installed with the following commands:\n```bash\nwget abyz.co.uk/rpi/pigpio/pigpio.zip\nunzip pigpio.zip\ncd PIGPIO\nmake\nsudo make install\n```\nBesides the library, the `pigpiod` utility is installed, which starts `pigpio` as daemon. The daemon must be running when using the `GpioDriver`.\n```bash\nsudo pigpiod\n```\n\n# Usage\n### Configuration\n`python-pwmled` supports several possibilities for connecting LEDs to your micro controller:\n- GPIO: LEDs can be connected directly to the GPIOs of a Raspberry Pi.\n- PCA9885: A [PCA9685](https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf) can be used as I2C-bus PWM controller.\n\n```python\nfrom pwmled.driver.gpio import GpioDriver\nfrom pwmled.driver.pca9685 import Pca9685Driver\n\n# GPIO driver, which controls pins 17, 22, 23\ndriver = GpioDriver([17, 22, 23])\ndriver = GpioDriver([17, 22, 23], freq=200)\n# To control the pigpio on a other machine use the host and port parameter\ndriver = GpioDriver([17, 22, 23], host='other.host', port=8889)\n\n# PCA9685 driver which controls pins 1, 2, 3\ndriver = Pca9685Driver([1, 2, 3])\ndriver = Pca9685Driver([1, 2, 3], freq=200, address=0x40)\n```\n\n### Control\nEach LED needs a separated driver, which controls the corresponding pins. The number and order of pins depends on the led type:\n- One-color: 1 pin\n- RGB: 3 pins (`[R, G, B]`)\n- RGBW: 4 pins (`[R, G, B, W]`)\n\nThe supported operations are shown in the following example:\n\n```python\nfrom pwmled import Color\nfrom pwmled.led import SimpleLed\nfrom pwmled.led.rgb import RgbLed\nfrom pwmled.led.rgbw import RgbwLed\nfrom pwmled.driver.gpio import GpioDriver\n\n# One-color led\ndriver = GpioDriver([C])\nled = SimpleLed(driver)\nled.on()\nled.brightness = 0.5\nled.transition(5, brightness=0)\nled.off()\n\n# RGB led\ndriver = GpioDriver([R, G, B])\nled = RgbLed(driver)\nled.on()\nled.color = Color(255, 0, 0)\nled.set(color=Color(0, 255, 0), brightness=0.5) # set two properties simultaneously\nled.transition(5, color=Color(0, 0, 255), brightness=1)\nled.off()\n\n# RGBW led\ndriver = GpioDriver([R, G, B, W])\nled = RgbwLed(driver)\n# RgbwLed has same interface as RgbLed\n```\n\n# Contributions\nPull-requests are welcome, especially for adding new drivers or led types.\n\n# License\nThis library is provided under [MIT license](https://raw.githubusercontent.com/soldag/python-pwmled/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoldag%2Fpython-pwmled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoldag%2Fpython-pwmled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoldag%2Fpython-pwmled/lists"}