{"id":15012488,"url":"https://github.com/microsoft/pxt-neopixel","last_synced_at":"2025-04-09T09:08:59.930Z","repository":{"id":41297248,"uuid":"64237288","full_name":"microsoft/pxt-neopixel","owner":"microsoft","description":"A Neo-Pixel package for pxt-microbit","archived":false,"fork":false,"pushed_at":"2024-08-19T16:58:13.000Z","size":342,"stargazers_count":62,"open_issues_count":26,"forks_count":143,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-02T07:08:37.527Z","etag":null,"topics":["makecode","microbit","neopixels","pxt","ws2812b"],"latest_commit_sha":null,"homepage":"https://makecode.microbit.org/pkg/microsoft/pxt-neopixel","language":"TypeScript","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/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-26T16:31:59.000Z","updated_at":"2025-03-29T23:32:15.000Z","dependencies_parsed_at":"2024-12-18T13:02:03.936Z","dependency_job_id":"3ebeda16-914d-4ac3-807d-ea593a864e62","html_url":"https://github.com/microsoft/pxt-neopixel","commit_stats":{"total_commits":167,"total_committers":20,"mean_commits":8.35,"dds":0.652694610778443,"last_synced_commit":"9ef28dd8ec9e72548391746025a2c252fc8f9998"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fpxt-neopixel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fpxt-neopixel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fpxt-neopixel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fpxt-neopixel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/pxt-neopixel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008630,"owners_count":21032556,"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":["makecode","microbit","neopixels","pxt","ws2812b"],"created_at":"2024-09-24T19:42:43.870Z","updated_at":"2025-04-09T09:08:59.913Z","avatar_url":"https://github.com/microsoft.png","language":"TypeScript","readme":"# NeoPixel driver\n\nThis library provides a driver for various Neo Pixel LED strips, \nsee https://www.adafruit.com/category/168.\n\nNeoPixels consist of programmable RGB LEDs (WS2812B), every one of them controlled\nseparately.  \n\n## ~ hint\n\nSee [Microsoft/pxt-ws2812b](https://makecode.microbit.org/pkg/microsoft/pxt-ws2812b) for basic WS2812B led support. \n\n## ~\n\n## Basic usage\n\n```blocks\n// Create a NeoPixel driver - specify the pin, number of LEDs, and the type of \n// the NeoPixel srip, either standard RGB (with GRB or RGB format) or RGB+White.\nlet strip = neopixel.create(DigitalPin.P0, 24, NeoPixelMode.RGB);\n\n// set pixel colors\nstrip.setPixelColor(0, NeoPixelColors.White); // white\nstrip.setPixelColor(1, 0xff0000);     // red\nstrip.setPixelColor(2, 0x00ff00);     // green\nstrip.setPixelColor(3, NeoPixelColors.Blue);    // blue\n\n// send the data to the strip\nstrip.show()\n```\n\nUse ``||setBrightness||`` to lower the brightness (it's maxed out by default).\n\nUse ``||shift||`` or ``||rotate||`` to shift the lights around.\n\nUse ``||setPixelWhiteLED||`` to set brightness of the white pixel for RGB+W strips. \n\n## HSL color format\n\nUse `neopixel.hslToRgb()` to create colors using hue, saturation, and lightness.\n\n## Example: Using accelerometer to control colors\n\nThis little program will let the position of the microbit control the color of the first LED.\nThis first LED will then get shifted further away every 100ms.\n\n```blocks\nlet strip = neopixel.create(DigitalPin.P0, 24, NeoPixelMode.RGB_RGB)\nwhile (true) {\n    let x = input.acceleration(Dimension.X) / 2;\n    let y = input.acceleration(Dimension.Y) / 2;\n    let z = input.acceleration(Dimension.Z) / 2;\n    strip.shift(1);\n    strip.setPixelColor(0, neopixel.rgb(x, y, -z));\n    strip.show();\n    basic.pause(100);\n}\n```\n\n## Supported targets\n\n* for PXT/microbit\n* for PXT/calliope\n\n## License\n\nMIT\n\n## Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fpxt-neopixel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fpxt-neopixel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fpxt-neopixel/lists"}