Skip to content

Neopixel library doesn't support RGBW LEDs #2478

Closed
@ghost

Description

Naively, I didn't take into account that these LEDs were RGBW, so I tried running the example code:

import machine, neopixel
np = neopixel.NeoPixel(machine.Pin(4), 8)
np.fill((0, 64, 0))
np.write()

Of course, that results in odd behavior. Not all LEDs light up, or light up in odd colors.

Simply changing the 3 to 4 for self.buf and adding a w entry to the tuple in neopixel.py makes it work correctly. Of course, doing that directly would break it for folks with regular RGB LEDs. What would be the appropriate design choice here?

I'd be willing to submit a PR if you folks tell me how you want it to act.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions