Hi guys, just wondering if its possible to make an array of multiple arrays.
Some background on the project: I have an AMG8833 and I have built multiple arrays of color pallets for it. The color pallets can be changed during runtime. I also use the color pallets for other things during runtime.
I would like to somehow make an array of arrays, to make it easier to pull from the arrays.
something like:
colorPalletesArray[]{
uint32_t IRONBOW [] {
some HEX numbers
}
uint32_t RAINBOW [] {
some more HEX numbers
}
}
at the moment I have it set up like this:
uint32_t nCamColor_HEX;
if (thermalCol == 0) {
nCamColor_HEX = IRONBOW [colorIndex];
}
else if (thermalCol == 1) {
nCamColor_HEX = RAINBOW [colorIndex];
}
else if (thermalCol == 3) {
nCamColor_HEX = BLACK_HOT [colorIndex];
}
else if (thermalCol == 4) {
nCamColor_HEX = WHITE_HOT [colorIndex];
}
else if (thermalCol == 2) {
nCamColor_HEX = ARCTIC [colorIndex];
}
else if (thermalCol == 6) {
nCamColor_HEX = OUTDOOR_ALERT [colorIndex];
}
I would much rather do away with the if/else chain and have it set up like this:
uint32_t nCamColor_HEX = colorPalletesArray[thermalCol] [colorIndex];
Could someone give me some pointers on how to do it?
Thanks