Hi everyone
I have a 2D array with 1 and 0 for turning on and off individual NeoPixels on a 30 LED strip. I try to use the 2D-array but it's not working. But if I declare an array like this:
int q[30]={1,1,0,0,1,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1};
And the 2D array looks like this:
int LEDOn[][30]=
{{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},
{0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
{0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0},
{0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0}};
I use this code to send data to the NeoPixel strip:
for(int ii=0;ii<strip.numPixels();ii++)
{
if(q[ii]==1) // if(LEDOn[2][ii]==1) Not working
{
strip.setPixelColor(ii, LightRoom.Color(0, 100, 0));
}
}
strip.show();
What's wrong with the 2D array?
I have been searching for answers but failed and I have tried and re write the code in many different ways but I'm out of options. So can someone please help me.