Hi everyone -  apologies if this has been covered somewhere - i did search

Hi everyone -

apologies if this has been covered somewhere - i did search the wiki and the user group here…

I am trying to establish an array of color palettes, similar to how Mark uses the “typedef void (*SimplePatternList[])();” code.

heres what i have:

decltype CRGBPallette16 (*SimplePalletteList[])();
SimplePalletteList colorBin = {Firepal_p,WaterFire_p,Simplefire_p};

tried ‘typedef’ instead of decltype… no dice there.

any ideas?

-JF

thanks @Daniel_Garcia !!!
i always struggled with pointers back when i took my intro to C++ class almost 15 years ago… so i need a &pointer on some pointer syntax.

why does the third palette in your example use an @? I know that * returns the value at that address… and & refers to that address. what does @ do - and why would i use that vs &?

i tried to implement this just as a basic declaration changing the ‘@’ to a ‘&’ (assumed typo). I got an error that the solution for is a bit over my head:

“conversion from ‘const CRGBPalette16*’ to non-scalar type ‘CRGBPalette16’ requested”

i got it to compile by making the array of palette pointers a const as well - is that an ok fix? ://

const CRGBPalette16 *colorBin[] = { &Firepal_p, &WaterFire_p, &Simplefire_p, &HalloweenColors_p};

again - thanks for the help and all the continued work on FastLED!

yup, that was a typo because I was typing this out on a phone.

I think making it const is ok, yes.