void setup() {
// sanity check delay - allows reprogramming if accidently blowing power w/leds
delay(500);
// For safety (to prevent too high of a power draw), the test case defaults to
// setting brightness to 25% brightness
LEDS.setBrightness(64);
LEDS.addLeds<WS2811, 12>(ledsRGB, NUM_LEDS);
LEDS.clear();
That’s one way to do it. The other variation on how to do it would be to get rid of the CHSV array and your call to hsv2rgb_rainbow and instead do this:
which uses the variation of hsv2rgb that works on a single CHSV object and a single CRGB object. This way you wouldn’t necessarily be doubling your memory usage.
Mark and I are still giving some thought to how we want to consider more tightly integrating the hsv transformations into the library automatically, and if we want to. I think we need to work on a couple more projects using things the way it currently is to work out some ideas.
but now, I’m going to step away from this for a few hours and go to a bbq - I was up late last night, accidentally implementing support for two more led chipsets. Oops.
Thanks guys. That helps. It seemed a little odd to me to have two arrays. In my real code I need to individually address the pixels I was just trying to create the simplest sample. Converting from hsv2rgb each time I change a color should be more efficient. It would be awesome at some point to be able to create a controlled with a HSV array instead and try to live in that color space all the time… That’s how I thought at first that it would work (without giving it much thought to be honest). Enjoy your BBQ. The weather’s sure set for it.
Zeke: that’s exactly where we want to get to. It’s not going to be easy, given the technical fact that the strips only speak RGB, and the MCUs have limited RAM and CPU power-- but that’s definitely the vision we’re trying to head toward.
That said, i do have a proof of concept that interleaved the translating hsv to rgb with writing led data out without impacting the speed of writing led data out - meaning you not only save the memory but you incur no time cost for the translation.
Because that’s what we’re about, giving you more in less
Awesome. Right now I’m not CPU bound so converting as I go will work, but I look forward to the future. I’d better buy some shades, it seems like it’s going to be bright.