Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RGB WS2812 LEDs do not work #14

Open
veryalien opened this issue Dec 10, 2017 · 1 comment
Open

RGB WS2812 LEDs do not work #14

veryalien opened this issue Dec 10, 2017 · 1 comment
Labels

Comments

@veryalien
Copy link

veryalien commented Dec 10, 2017

A strip of 8 'standard' WS2812b RGB LEDs used as a light on a pan tilt hat just flickers random colours on the first 5 or 6 LEDs.
I don't have any RGBW LEDs to use as a comparison test.
This has been reported in the pimoroni forums by other users, but I don't think it has been resolved.

@Gadgetoid
Copy link
Member

Looks like support for RGB is mixed- the ones I tested with (a small NeoPixel ring) still work, but certain variations do not. The WS2812s are driven directly by firmware on the PIC16F1503 which;

  1. Doesn't have much margin for tweaks
  2. Can't (easily) be updated in the field

I think it's safer for us to recommend a list of compatible LED products than to risk changing the firmware now, since I don't know what knock-on effect it might have on other WS2812 variants (present & future).

Fixing the code is problematic because the timings are so tight that the code to update the LEDs doesn't have anywhere really to go, briefly it looks like this:

for each colour channel
    for each bit in colour channel
        if bit is set
            write WS2812_DATA HIGH
            write WS2812_DATA HIGH
            write WS2812_DATA LOW
        else
            write WS2812_DATA HIGH
            write WS2812_DATA LOW

... yes, the only difference between a WS2812 1 pulse and 0 pulse is that the DATA pin is set HIGH twice in a row to increase its duration.

There's actually some loop unrolling, clever instruction ordering and other tricks that can improve this, but it's a delicate balancing act.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants