Skip to content

Support different pixel orders and RGBW strips #1

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

Closed
tannewt opened this issue Nov 30, 2016 · 10 comments
Closed

Support different pixel orders and RGBW strips #1

tannewt opened this issue Nov 30, 2016 · 10 comments

Comments

@tannewt
Copy link
Member

tannewt commented Nov 30, 2016

Right now the neopixel modules supports GRB order 400khz and 800khz pixel strips. We should update the module to support a wider range of pixel types:

RGB and other arbitrary byte orders
RGBW strips
This can probably all be done in the Python module as the low level pixel write function just takes an array of bytes to send out to the pixels (so it can change from 3-tuples to 4-tuples of color info for RGBW easily).

@mcauser
Copy link

mcauser commented Dec 5, 2016

@tannewt
Copy link
Member Author

tannewt commented Jan 24, 2018

This is done. The constructor takes bpp which can be 4 for RGBW pixels.

@tannewt tannewt closed this as completed Jan 24, 2018
@caternuson
Copy link
Contributor

Reopening to address the pixel order part of the issue. How about this:

  • Create a dictionary to map string based pixel order definitions to associated order tuple
  • Add parameter to __init__ to allow passing this in
  • Set the ORDER tuple from the dictionary using the passed in parameter as key

Ex:
pixels = neopixel.NeoPixel(board.NEOPIXEL, 1, pixel_order="RGB")

@caternuson caternuson reopened this Feb 21, 2018
@ladyada
Copy link
Member

ladyada commented Feb 21, 2018

im cool w/this but rather than passing in "RGB" lets have a constant such as neopixel.RGB?

@caternuson
Copy link
Contributor

caternuson commented Feb 21, 2018

Additionally, bpp could be set based on this argument. But probably shouldn't remove bpp from __init__? (would possibly break current examples)

I'm fine with constants. So this:
pixels = neopixel.NeoPixel(board.NEOPIXEL, 1, pixel_order=neopixel.RGB)

@ladyada
Copy link
Member

ladyada commented Feb 21, 2018

id leave bpp but prioritize if order is defined

@caternuson
Copy link
Contributor

There's a rough draft PR. Comment on it over there. Will make lint happy and update doc examples if this seems like the right approach.

@ladyada
Copy link
Member

ladyada commented Feb 21, 2018

i think we can just have the RGBW = (0, 1, 2, 3) rather than index?

@caternuson
Copy link
Contributor

Good call, was over thinking it. Removed the dict.

@caternuson
Copy link
Contributor

Closing back up. Different pixel order support added by: #24

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

No branches or pull requests

4 participants