I'm trying to make a loop that triggers a list of arrays I've declared. But nothing seems to work so far.
The goal is to let the loop create an animation on Neopixels. The arrays are keyframes of that animation, I know, there are probably better and more efficient ways to do this. But this will probably meet my requirements.
So I've tried it like this already:
const int startSwipe0[][4] = {whole list of numbers};
const int startSwipe1[][4] = {whole list of numbers};
const int startSwipe2[][4] = {whole list of numbers};
const int startSwipe3[][4] = {whole list of numbers};
const int startSwipe4[][4] = {whole list of numbers};
const int startSwipe5[][4] = {whole list of numbers};
void setup() {
strip.begin();
strip.setBrightness(100); // 0-255 brightness
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
currentTime = millis();
animation_a();
strip.show();
}
void animation_a() {
for (int j=0; j<6; j++) {
for (int i=0; i<NUM_LEDS; i++) {
String swipeInt = String(j);
String swipeName = "startSwipe"+swipeInt;
Serial.println(swipeName);
strip.setPixelColor(i, swipeName[i][1], swipeName[i][2], swipeName[i][3]);
}
}
}
But this gives this error "invalid types 'char[int]' for array subscript" but it does print the same name as my array names.
Please help! Thanks!