I have a short general question. In my new project I’m working with blend and dimming a lot and my Question is why can’t I use FastLED.addleds with a CHSV Array? This would be very practical, because I need sometimes the actual color on the stripe for HSV blending…
My thought is that I have to copy the values first in a HSV Array and then into the RGB, but I think this needs time and is not so good. Any thoughts about this?
The short answer is that this is because the actual LED strip itself is an RGB hardware device, and FastLED communicates with is directly that way.
The HSV ‘view’ is a higher layer on top of that, with FastLED providing software conversions to RGB.
Daniel and I (and others!) both agree that it would be nice to have the ‘main’ LED array be HSV or palette-based, but (1) AVR Arduinos probably aren’t fast enough to support the necessary on-the-fly conversion math, and we’re not quite ready to introduce it as an ARM-only feature yet, and (2) we have other development work to tackle first.
The existing software conversion routines are pretty fast. It’s totally reasonable to register an RGB array with addLeds, but do all of your animation work in a CHSV array. Then just before ‘show’, do this:
hsv2rgb_rainbow( myHSVs, myRGBs, NUM_LEDS);
That will convert the whole HSV array into RGB at once, and it can then be show’ed.
The only problem here is that it takes up more memory, but that problem can be solved by just choosing an MCU with enough for your application. Not perfect, but totally workable.
Thanks @Mark_Kriegsman for your fast reply. I use a teensy 3.1 so the memory shouldn’t be a problem. And I can understand why this feature isn’t available. Thanks for this hint 