{"id":13613323,"url":"https://github.com/JanBednarik/micropython-ws2812","last_synced_at":"2025-04-13T15:32:59.856Z","repository":{"id":22935384,"uuid":"26284591","full_name":"JanBednarik/micropython-ws2812","owner":"JanBednarik","description":"MicroPython driver for WS2812 RGB LEDs (WS2812B, AdaFruit NeoPixels, ...).","archived":false,"fork":false,"pushed_at":"2023-02-05T23:14:05.000Z","size":11,"stargazers_count":189,"open_issues_count":3,"forks_count":50,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-07T21:42:00.558Z","etag":null,"topics":[],"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/JanBednarik.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}},"created_at":"2014-11-06T18:52:24.000Z","updated_at":"2024-10-17T15:53:35.000Z","dependencies_parsed_at":"2023-02-19T02:31:44.582Z","dependency_job_id":null,"html_url":"https://github.com/JanBednarik/micropython-ws2812","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanBednarik%2Fmicropython-ws2812","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanBednarik%2Fmicropython-ws2812/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanBednarik%2Fmicropython-ws2812/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanBednarik%2Fmicropython-ws2812/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JanBednarik","download_url":"https://codeload.github.com/JanBednarik/micropython-ws2812/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248736098,"owners_count":21153533,"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":[],"created_at":"2024-08-01T20:00:44.255Z","updated_at":"2025-04-13T15:32:59.640Z","avatar_url":"https://github.com/JanBednarik.png","language":"Python","funding_links":[],"categories":["Libraries","精选驱动库"],"sub_categories":["Display","显示类"],"readme":"MicroPython WS2812 driver\n=========================\n\nMicroPython driver for WS2812, WS2812B, and compatible RGB LEDs. These are\npopular RGB LEDs used for example in AdaFruit NeoPixels rings, strips, boards,\netc.\n\nDriver has been tested with up to 240 LEDs (4m of NeoPixels stripe) but it\nshould work with much more LEDs.\n\nInstallation\n------------\n\nCopy `ws2812.py` file to your pyboard.\n\nUsage\n-----\n\n```\nfrom ws2812 import WS2812\nchain = WS2812(spi_bus=1, led_count=4)\ndata = [\n    (255, 0, 0),    # red\n    (0, 255, 0),    # green\n    (0, 0, 255),    # blue\n    (85, 85, 85),   # white\n]\nchain.show(data)\n```\n\nThere are files `example_simple.py` and `example_advanced.py` prepared for\nNeoPixels ring (or similar) with 16 RGB LEDs. If you have it connected to SPI\nbus 1 then just copy `example_simple.py` or `example_advanced.py` as `main.py`\nto your pyboard and reset your pyboard.\n\nVideo of `example_advanced.py` in action: http://youtu.be/ADYxiG40UJ0\n\n`example_240_leds.py` are some animations for 4 meters of NeoPixels strip with\n240 RGB LEDs. In action video: http://youtu.be/vb5l3h1-TqA\n\nWiring\n------\n\nWS2812 driver is using SPI bus. Connect your LED's input wire to the SPI bus 1\nMOSI (pin X8 on pyboard) or SPI bus 2 MOSI (pin Y8 on pyboard). Connect LED's\npower and ground wires to VIN and GND on pyboard. The same applies for LED\nrings, stripes, etc. (they have always one input wire).\n\nUSB may be insufficient for powering lots of RGB LEDs. You may need to use\nadditional power source.\n\nMore info \u0026 Help\n----------------\n\nYou can check more about the MicroPython project here: http://micropython.org\n\nDiscussion about this driver: http://forum.micropython.org/viewtopic.php?f=5\u0026t=394\n\nChangelog\n---------\n\n* 1.3 - Allow updating only part of the buffer; re-add send_buf\n* 1.2 - Disable IRQ feature removed. (It's not neccesary in newer versions of\n  MicroPython.)\n* 1.1 - Speed optimisations.\n* 1.0 - First release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJanBednarik%2Fmicropython-ws2812","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJanBednarik%2Fmicropython-ws2812","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJanBednarik%2Fmicropython-ws2812/lists"}