void animation()
{
   for(int i = 0; i < time; i++)
{ 
   digitalWrite(L1,HIGH);
   digitalWrite(L2,LOW);
   digitalWrite(L3,LOW);
   digitalWrite(L4,LOW); 
   
   digitalWrite(rAa,nrot[0]); digitalWrite(rAb,nrot[1]); digitalWrite(rAc,nrot[2]); digitalWrite(rAd,nrot[3]);
   digitalWrite(rBa,nrot[4]); digitalWrite(rBb,nrot[5]); digitalWrite(rBc,nrot[6]); digitalWrite(rBd,nrot[7]);
   digitalWrite(rCa,nrot[8]); digitalWrite(rCb,nrot[9]); digitalWrite(rCc,nrot[10]);digitalWrite(rCd,nrot[11]);
   digitalWrite(rDa,nrot[12]);digitalWrite(rDb,nrot[13]);digitalWrite(rDc,nrot[14]);digitalWrite(rDd,nrot[15]);
   
   digitalWrite(gAa,ngrun[0]); digitalWrite(gAb,ngrun[1]); digitalWrite(gAc,ngrun[2]); digitalWrite(gAd,ngrun[3]);
   digitalWrite(gBa,ngrun[4]); digitalWrite(gBb,ngrun[5]); digitalWrite(gBc,ngrun[6]); digitalWrite(gBd,ngrun[7]);
   digitalWrite(gCa,ngrun[8]); digitalWrite(gCb,ngrun[9]); digitalWrite(gCc,ngrun[10]);digitalWrite(gCd,ngrun[11]);
   digitalWrite(gDa,ngrun[12]);digitalWrite(gDb,ngrun[13]);digitalWrite(gDc,ngrun[14]);digitalWrite(gDd,ngrun[15]);
   
   digitalWrite(bAa,blau[0]); digitalWrite(bAb,blau[1]); digitalWrite(bAc,blau[2]); digitalWrite(bAd,blau[3]);
   digitalWrite(bBa,blau[4]); digitalWrite(bBb,blau[5]); digitalWrite(bBc,blau[6]); digitalWrite(bBd,blau[7]);
   digitalWrite(bCa,blau[8]); digitalWrite(bCb,blau[9]); digitalWrite(bCc,blau[10]);digitalWrite(bCd,blau[11]);
   digitalWrite(bDa,blau[12]);digitalWrite(bDb,blau[13]);digitalWrite(bDc,blau[14]);digitalWrite(bDd,blau[15]);
   delay(1);
   
   digitalWrite(gAa,grun[0]); digitalWrite(gAb,grun[1]); digitalWrite(gAc,grun[2]); digitalWrite(gAd,grun[3]);
   digitalWrite(gBa,grun[4]); digitalWrite(gBb,grun[5]); digitalWrite(gBc,grun[6]); digitalWrite(gBd,grun[7]);
   digitalWrite(gCa,grun[8]); digitalWrite(gCb,grun[9]); digitalWrite(gCc,grun[10]);digitalWrite(gCd,grun[11]);
   digitalWrite(gDa,grun[12]);digitalWrite(gDb,grun[13]);digitalWrite(gDc,grun[14]);digitalWrite(gDd,grun[15]);
   delay(1);
   
   digitalWrite(rAa,rot[0]); digitalWrite(rAb,rot[1]); digitalWrite(rAc,rot[2]); digitalWrite(rAd,rot[3]);
   digitalWrite(rBa,rot[4]); digitalWrite(rBb,rot[5]); digitalWrite(rBc,rot[6]); digitalWrite(rBd,rot[7]);
   digitalWrite(rCa,rot[8]); digitalWrite(rCb,rot[9]); digitalWrite(rCc,rot[10]);digitalWrite(rCd,rot[11]);
   digitalWrite(rDa,rot[12]);digitalWrite(rDb,rot[13]);digitalWrite(rDc,rot[14]);digitalWrite(rDd,rot[15]);
   delay(1);
   
   digitalWrite(L1,LOW);
   digitalWrite(L2,HIGH);
   digitalWrite(L3,LOW);
   digitalWrite(L4,LOW); 
   
   digitalWrite(rAa,nrot[16]); digitalWrite(rAb,nrot[17]); digitalWrite(rAc,nrot[18]); digitalWrite(rAd,nrot[19]);
   digitalWrite(rBa,nrot[20]); digitalWrite(rBb,nrot[21]); digitalWrite(rBc,nrot[22]); digitalWrite(rBd,nrot[23]);
   digitalWrite(rCa,nrot[24]); digitalWrite(rCb,nrot[25]); digitalWrite(rCc,nrot[26]); digitalWrite(rCd,nrot[27]);
   digitalWrite(rDa,nrot[28]); digitalWrite(rDb,nrot[29]); digitalWrite(rDc,nrot[30]); digitalWrite(rDd,nrot[31]);
   
   digitalWrite(gAa,ngrun[16]); digitalWrite(gAb,ngrun[17]); digitalWrite(gAc,ngrun[2]);  digitalWrite(gAd,ngrun[3]);
   digitalWrite(gBa,ngrun[20]); digitalWrite(gBb,ngrun[21]); digitalWrite(gBc,ngrun[22]); digitalWrite(gBd,ngrun[23]);
   digitalWrite(gCa,ngrun[24]); digitalWrite(gCb,ngrun[25]); digitalWrite(gCc,ngrun[26]); digitalWrite(gCd,ngrun[27]);
   digitalWrite(gDa,ngrun[28]); digitalWrite(gDb,ngrun[29]); digitalWrite(gDc,ngrun[30]); digitalWrite(gDd,ngrun[31]);
   
   digitalWrite(bAa,blau[16]); digitalWrite(bAb,blau[17]); digitalWrite(bAc,blau[18]); digitalWrite(bAd,blau[19]);
   digitalWrite(bBa,blau[20]); digitalWrite(bBb,blau[21]); digitalWrite(bBc,blau[22]); digitalWrite(bBd,blau[23]);
   digitalWrite(bCa,blau[24]); digitalWrite(bCb,blau[25]); digitalWrite(bCc,blau[26]); digitalWrite(bCd,blau[27]);
   digitalWrite(bDa,blau[28]); digitalWrite(bDb,blau[29]); digitalWrite(bDc,blau[30]); digitalWrite(bDd,blau[31]);
   delay(1);
   
   digitalWrite(gAa,grun[16]); digitalWrite(gAb,grun[17]); digitalWrite(gAc,grun[18]); digitalWrite(gAd,grun[19]);
   digitalWrite(gBa,grun[20]); digitalWrite(gBb,grun[21]); digitalWrite(gBc,grun[22]); digitalWrite(gBd,grun[23]);
   digitalWrite(gCa,grun[24]); digitalWrite(gCb,grun[25]); digitalWrite(gCc,grun[26]); digitalWrite(gCd,grun[27]);
   digitalWrite(gDa,grun[28]); digitalWrite(gDb,grun[29]); digitalWrite(gDc,grun[30]); digitalWrite(gDd,grun[31]);
   delay(1);
   
   digitalWrite(rAa,rot[16]); digitalWrite(rAb,rot[17]); digitalWrite(rAc,rot[18]); digitalWrite(rAd,rot[19]);
   digitalWrite(rBa,rot[20]); digitalWrite(rBb,rot[21]); digitalWrite(rBc,rot[22]); digitalWrite(rBd,rot[23]);
   digitalWrite(rCa,rot[24]); digitalWrite(rCb,rot[25]); digitalWrite(rCc,rot[26]); digitalWrite(rCd,rot[27]);
   digitalWrite(rDa,rot[28]); digitalWrite(rDb,rot[29]); digitalWrite(rDc,rot[30]); digitalWrite(rDd,rot[31]);
   delay(1);  
   
   digitalWrite(L1,LOW);
   digitalWrite(L2,LOW);
   digitalWrite(L3,HIGH);
   digitalWrite(L4,LOW); 
   
   digitalWrite(rAa,nrot[32]); digitalWrite(rAb,nrot[33]); digitalWrite(rAc,nrot[34]); digitalWrite(rAd,nrot[35]);
   digitalWrite(rBa,nrot[36]); digitalWrite(rBb,nrot[37]); digitalWrite(rBc,nrot[38]); digitalWrite(rBd,nrot[39]);
   digitalWrite(rCa,nrot[40]); digitalWrite(rCb,nrot[41]); digitalWrite(rCc,nrot[42]); digitalWrite(rCd,nrot[43]);
   digitalWrite(rDa,nrot[44]); digitalWrite(rDb,nrot[45]); digitalWrite(rDc,nrot[46]); digitalWrite(rDd,nrot[47]);
   
   digitalWrite(gAa,ngrun[32]); digitalWrite(gAb,ngrun[33]); digitalWrite(gAc,ngrun[34]); digitalWrite(gAd,ngrun[35]);
   digitalWrite(gBa,ngrun[36]); digitalWrite(gBb,ngrun[37]); digitalWrite(gBc,ngrun[38]); digitalWrite(gBd,ngrun[39]);
   digitalWrite(gCa,ngrun[40]); digitalWrite(gCb,ngrun[41]); digitalWrite(gCc,ngrun[42]); digitalWrite(gCd,ngrun[43]);
   digitalWrite(gDa,ngrun[44]); digitalWrite(gDb,ngrun[45]); digitalWrite(gDc,ngrun[46]); digitalWrite(gDd,ngrun[47]);
   
   digitalWrite(bAa,blau[32]); digitalWrite(bAb,blau[33]); digitalWrite(bAc,blau[34]); digitalWrite(bAd,blau[35]);
   digitalWrite(bBa,blau[36]); digitalWrite(bBb,blau[37]); digitalWrite(bBc,blau[38]); digitalWrite(bBd,blau[39]);
   digitalWrite(bCa,blau[40]); digitalWrite(bCb,blau[41]); digitalWrite(bCc,blau[42]); digitalWrite(bCd,blau[43]);
   digitalWrite(bDa,blau[44]); digitalWrite(bDb,blau[45]); digitalWrite(bDc,blau[46]); digitalWrite(bDd,blau[47]);
   delay(1);
   
   digitalWrite(gAa,grun[32]); digitalWrite(gAb,grun[33]); digitalWrite(gAc,grun[34]); digitalWrite(gAd,grun[35]);
   digitalWrite(gBa,grun[36]); digitalWrite(gBb,grun[37]); digitalWrite(gBc,grun[38]); digitalWrite(gBd,grun[39]);
   digitalWrite(gCa,grun[40]); digitalWrite(gCb,grun[41]); digitalWrite(gCc,grun[42]); digitalWrite(gCd,grun[43]);
   digitalWrite(gDa,grun[44]); digitalWrite(gDb,grun[45]); digitalWrite(gDc,grun[46]); digitalWrite(gDd,grun[47]);
   delay(1);
   
   digitalWrite(rAa,rot[32]); digitalWrite(rAb,rot[33]); digitalWrite(rAc,rot[34]); digitalWrite(rAd,rot[35]);
   digitalWrite(rBa,rot[36]); digitalWrite(rBb,rot[37]); digitalWrite(rBc,rot[38]); digitalWrite(rBd,rot[39]);
   digitalWrite(rCa,rot[40]); digitalWrite(rCb,rot[41]); digitalWrite(rCc,rot[42]); digitalWrite(rCd,rot[43]);
   digitalWrite(rDa,rot[44]); digitalWrite(rDb,rot[45]); digitalWrite(rDc,rot[46]); digitalWrite(rDd,rot[47]);
   delay(1); 
   
   digitalWrite(L1,LOW);
   digitalWrite(L2,LOW);
   digitalWrite(L3,LOW);
   digitalWrite(L4,HIGH); 
   
   digitalWrite(rAa,nrot[48]); digitalWrite(rAb,nrot[49]); digitalWrite(rAc,nrot[50]); digitalWrite(rAd,nrot[51]);
   digitalWrite(rBa,nrot[52]); digitalWrite(rBb,nrot[53]); digitalWrite(rBc,nrot[54]); digitalWrite(rBd,nrot[55]);
   digitalWrite(rCa,nrot[56]); digitalWrite(rCb,nrot[57]); digitalWrite(rCc,nrot[58]); digitalWrite(rCd,nrot[59]);
   digitalWrite(rDa,nrot[60]); digitalWrite(rDb,nrot[61]); digitalWrite(rDc,nrot[62]); digitalWrite(rDd,nrot[63]);
   
   digitalWrite(gAa,ngrun[48]); digitalWrite(gAb,ngrun[49]); digitalWrite(gAc,ngrun[50]); digitalWrite(gAd,ngrun[51]);
   digitalWrite(gBa,ngrun[52]); digitalWrite(gBb,ngrun[53]); digitalWrite(gBc,ngrun[54]); digitalWrite(gBd,ngrun[55]);
   digitalWrite(gCa,ngrun[56]); digitalWrite(gCb,ngrun[57]); digitalWrite(gCc,ngrun[58]); digitalWrite(gCd,ngrun[59]);
   digitalWrite(gDa,ngrun[60]); digitalWrite(gDb,ngrun[61]); digitalWrite(gDc,ngrun[62]); digitalWrite(gDd,ngrun[63]);
   
   digitalWrite(bAa,blau[48]); digitalWrite(bAb,blau[49]); digitalWrite(bAc,blau[50]); digitalWrite(bAd,blau[51]);
   digitalWrite(bBa,blau[52]); digitalWrite(bBb,blau[53]); digitalWrite(bBc,blau[54]); digitalWrite(bBd,blau[55]);
   digitalWrite(bCa,blau[56]); digitalWrite(bCb,blau[57]); digitalWrite(bCc,blau[58]); digitalWrite(bCd,blau[59]);
   digitalWrite(bDa,blau[60]); digitalWrite(bDb,blau[61]); digitalWrite(bDc,blau[62]); digitalWrite(bDd,blau[63]);
   delay(1);
   
   digitalWrite(gAa,grun[48]); digitalWrite(gAb,grun[49]); digitalWrite(gAc,grun[50]); digitalWrite(gAd,grun[51]);
   digitalWrite(gBa,grun[52]); digitalWrite(gBb,grun[53]); digitalWrite(gBc,grun[54]); digitalWrite(gBd,grun[55]);
   digitalWrite(gCa,grun[56]); digitalWrite(gCb,grun[57]); digitalWrite(gCc,grun[58]); digitalWrite(gCd,grun[59]);
   digitalWrite(gDa,grun[60]); digitalWrite(gDb,grun[61]); digitalWrite(gDc,grun[62]); digitalWrite(gDd,grun[63]);
   delay(1);
   
   digitalWrite(rAa,rot[48]); digitalWrite(rAb,rot[49]); digitalWrite(rAc,rot[50]); digitalWrite(rAd,rot[51]);
   digitalWrite(rBa,rot[52]); digitalWrite(rBb,rot[53]); digitalWrite(rBc,rot[54]); digitalWrite(rBd,rot[55]);
   digitalWrite(rCa,rot[56]); digitalWrite(rCb,rot[57]); digitalWrite(rCc,rot[58]); digitalWrite(rCd,rot[59]);
   digitalWrite(rDa,rot[60]); digitalWrite(rDb,rot[61]); digitalWrite(rDc,rot[62]); digitalWrite(rDd,rot[63]);
   delay(1);  
   }
}
