Thanks for looking!
Background
I am building a quadcopter and am placing on each of it's four arms a strip of RGB LEDs which are individually addressable. There are 6 LEDs per strip.
Further, there are six steps in a sequence to how I wish to toggle the lights so all six lights on the strip don't necessarily toggle at once.
In pseudo code, here is what I am trying to create:
someArray = A group of 4 LED strips {Strip 1: [
Step 1: [ LED 1: [R, G, B], . . ., LED 6: [R, G, B] ],
. . .,
Step 6: [ LED 1: [R, G, B], . . ., LED 6: [R, G, B] ],
],
. . .,
Strip 4: [
Step 1: [ LED 1: [R, G, B], . . ., LED 6: [R, G, B] ],
. . .,
Step 6: [ LED 1: [R, G, B], . . ., LED 6: [R, G, B] ],
]};
I am using an Arduino to drive the lights, and the code is in C++ with which I am not very familiar.
What I have tried so far:
Here is the code I have tried so far, but when I compile in the Arduino IDE, I get an error that says "Braces around scalar initializer for type 'int'".
int gpsHoldArr[4][6][6] = {
{
{{255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}}
},
{
{{255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}}
},
{
{{255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}}
},
{
{{255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {0,0,0}},
{{255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}, {255,0,0}}
},
};
What am I missing here?
Intended Usage
Intended use would be something like this:
//iterate each of the 6 sets of RGB values and assign them to the correct (sequential) LED
void toggleLights(int lights[]){
for(int i = 0; i <= 6; ++i)
{
set_color_led(i, lights[i][0], lights[i][1], lights[i][2]);
}
}
toggleLights(gpsHoldArr[1][0]);//Get the first step of the second arm.
Thanks in advance.