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0,0,0,0,0,0}
};
void setup() {
// put your setup code here, to run once:
lc.shutdown(0,false);
lc.shutdown(1,false);
lc.setIntensity(0,8);
lc.setIntensity(1,8);
lc.clearDisplay(0);
lc.clearDisplay(1);
}
void loop() {
for(int j=0;j<8;j++)
{
for(int i=0;i<8;i++)
{
/*int num = (j + position) % 64;
lc.setLed(0,i,j,a[i][num]);
lc.setLed(1,i,j,a[i][(num+8) % 64]);*/
lc.setLed(0,j,i,a[j][i+position]-abs((i+position)/54)*54+24);
lc.setLed(1,j,i,a[j][i+position]-abs((i+position)/54)*54);
}
}
delay(100);
position=(position+1)%64;
}