jasoncoon / esp8266-fastled-webserver

GNU General Public License v3.0
713 stars 359 forks source link

No Solid Color #195

Closed dieterdrost closed 2 years ago

dieterdrost commented 3 years ago

Hi,

I got the great project to work. Nicely done but i got a small issue that i cannot get a solid color and the TwinkleFox patterns arent working either. When i use a Solid Color i get RGB so 1 led green 1 led red and 1 led blue and so one for the entire led.

Can you help met or point me in the richt direction.

Thanks. Greetings Dieter

FranzKropp commented 3 years ago

What kind of Strip do you use?

henrygab commented 2 years ago

Summary

Unfortunately, the library this project relies upon (FastLED) currently supports only RGB pixels. It sounds like your strip is RGBW, and thus would not be supported.

Details

Your symptoms correlate to the use of an RGBW strip, when the output is for RGB strip. Are you also getting only 3/4 of the number of pixels to light up?

Pixels expect one byte per each color of LED (e.g., one byte for red, one byte for green, one byte for blue, one byte for white, etc.)

For an RGB pixels, that's three bytes of data, so sending a solid color for four pixels could look like this:

RGB  Strip Data:   R   G   B   R   G   B   R   G   B   R   G   B ...
                 255   0   0 255   0   0 255   0   0 255   0   0 ...
                 \___red___/ \___red___/ \___red___/ \___red___/

For RGBW pixels, there's four LEDs per pixels. Sending a solid color for three RGBW pixels could look like this:

RGBW Strip Data:   R   G   B   W   R   G   B   W   R   G   B   W ...
                 255   0   0   0 255   0   0   0 255   0   0   0 ...
                 \_____red_____/ \_____red_____/ \_____red_____/

When sending data that is formatted for RGB pixels to RGBW pixels, you will get the odd color results you mention. For example, when you send the solid color data example from above, here's what you get:

RGB  Strip Data:   R   G   B   R   G   B   R   G   B   R   G   B ...
                 255   0   0 255   0   0 255   0   0 255   0   0 ...
                 \___red___/ \___red___/ \___red___/ \___red___/
RGBW Strip Data:   R   G   B   W   R   G   B   W   R   G   B   W ...
                 255   0   0 255   0   0 255   0   0 255   0   0 ...
                 \___red+w_____/ \____blue_____/ \____green____/