neopixel: add PIO-based WS2812B driver for RP2040/RP2350#849
Closed
gandarez wants to merge 1 commit intotinygo-org:devfrom
Closed
neopixel: add PIO-based WS2812B driver for RP2040/RP2350#849gandarez wants to merge 1 commit intotinygo-org:devfrom
gandarez wants to merge 1 commit intotinygo-org:devfrom
Conversation
The existing ws2812 bit-bang driver fails on RP2350 (Cortex-M33) due to timing differences from M0+. This adds a neopixel package that uses PIO via tinygo-org/pio for hardware-timed LED control on RP2040/RP2350, with a fallback to the ws2812 bit-bang driver on other platforms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
soypat
approved these changes
Mar 28, 2026
Contributor
|
Looks good! Ready to merge? |
Member
|
@gandarez I just wonder if this might be able to be added directly to the existing What do you think? |
Contributor
Author
|
Let me check if it's possible |
Contributor
Author
|
Closing due to #851 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
neopixelpackage that provides an Adafruit NeoPixel-like API for WS2812B RGB LED stripstinygo-org/pio) for hardware-timed control on RP2040/RP2350, fixing the issue where the existingws2812bit-bang driver fails on RP2350's Cortex-M33ws2812bit-bang driver on all other platformsMotivation
The existing
ws2812driver uses CPU-timed bit-banging assembly tuned for Cortex-M0+. The RP2350's Cortex-M33 has a write buffer and different pipeline that breaks the nanosecond-level GPIO timing. The Arduino Adafruit_NeoPixel library works on the same hardware because it uses PIO.API
Test plan
tinygo flash -target=pico2 ./examples/neopixel/— verify LED cycles Red → Green → Blue on Waveshare RP2350🤖 Generated with Claude Code