Hi a quick question about all Helper methods which takes a Array of CRGB.

Hi a quick question about all Helper methods which takes a Array of CRGB. For example the fill_rainbow method from FastLed

void fill_rainbow( struct CRGB * pFirstLED, int numToFill,
uint8_t initialhue,
uint8_t deltahue )
{
CHSV hsv;
hsv.hue = initialhue;
hsv.val = 255;
hsv.sat = 240;
for( int i = 0; i < numToFill; i++) {
pFirstLED[i] = hsv;
hsv.hue += deltahue;
}
}

so i have the case that i have a array of 1280 leds… (some are actually inexistent but this is caused by the octows2811 libary which assumes every strip has the same length. in my case they start from 7 leds to 160)

so now i would like to play a rainbow animation starting from led 40 until led 80. how do i achieve that? hue stands for some color ranges right?.

do i really need to make a new array containing only the 40 leds to update and then somehow merge this arrays back together? From my point of view that looks very Memory and time consuming so a waste of resources. surly i could copy the method and make the value from i parametriced. But my guess is that there is somehow a good way to this and i just don’t know of it.

Maybe use a method to map led number to index of leds array?

Yeah the fact is i’m not a cc++ programmer and if i do a loop to read out the array part it seems to be very inefficient. So i’m looking for the quickest way to do theat.

Or i could split my initial array into multiple only holding pointers to the crgb object that would be fine for me… can anyone show me code how to achieve that. that would be fine for me.

This should help

Actually na id didn’t :wink: because there seems to be no CRGBSet or CRGBArray (examples are not quite consistent ) from which version on does it exist? i’m using 30001000

okay i updated now to 3000010003 the CRGBArray is now here but i have the issue that the compiler complains about not having octows2813 declared is this because i’m using a to old version of octows libary?

so i updatet the libaries but now i have following error:
E:\ide\Teensyduino\arduino-1.8.1\hardware\teensy\avr\libraries\FastLED/FastLED.h:359:12: error: ‘OCTOWS2813’ was not declared in this scope
case OCTOWS2813: { static COctoWS2811Controller<RGB_ORDER,WS2813_800kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
^

I even updated the teensyduino to the lates version so i get the lates octows2811 libary…

so i figured it out but why the hell is a broken Fastled.h file as official release on the website? enum OWS2811 { OCTOWS2811,OCTOWS2811_400,OCTOWS2813 }; had to add it here in the fastled.h

@Jeremy_Spencer so i broke my toolchain fixed it again and now i have the still no CRGBArray included in the FastLed libary… i’m somehow missing the point :wink: EDIT: sorry right after this post it worked somehow i just klicked once more the compile button… never mind

Glad you got it working :slight_smile:

Yeah me to… :wink: