Makuna / NeoPixelBus

An Arduino NeoPixel support library supporting a large variety of individually addressable LEDs. Please refer to the Wiki for more details. Please use the GitHub Discussions to ask questions as the GitHub Issues feature is used for bug tracking.
GNU Lesser General Public License v3.0
1.18k stars 261 forks source link

Add support for 8-bit color with WS2816 #707

Closed mcer12 closed 1 year ago

mcer12 commented 1 year ago

Default examples don't work because of this incompatibility. Adding a simple 8bit lookup table to RgbColor for high resolution chips (and thus allowing to use standard 8bit resolution) would make preliminary testing and adding support for these chips in projects much easier.

Or maybe support for 8bit NeoGrbFeature in NeoWs2816Method and do the conversion just before sending, whichever makes more sense.

Makuna commented 1 year ago

Please follow the templates provided for issues and include the information it maps out. You are missing so many details here. What default examples?

The Feature is the one that translates into the data stream byte format the pixels expect, the method is the one that MAY translate into the needed format hardware uses to output the stream byte format. So the feature can't do what you maybe thinking.
NOTE: Not all methods do any translation at all; like bitbang methods for example.

Please provide exactly what definition you are using and how it's not working. Be complete and concise.

RgbColor can be used directly when calling strip.SetPixelColor(). strip.GetPixelColor returns a 16 bits per element Rgb48Color thus will not auto-convert to an 8-bit due to a loss of information from 16 down to 8 bits. It is a bad idea to lose information for a sketch writer without them knowing so it will never do this. You have to explicitly convert it.

Makuna commented 1 year ago

...waiting on specifics...

Makuna commented 1 year ago

If I don't hear a response, I will be closing this issue.

To get the pixel color, you simply have to call GetPixelColor like this...

    RgbColor color = RgbColor(strip.GetPixelColor( 1 ));
Makuna commented 1 year ago

closed due to a lack of response for more details on the specific issue.