/*
Empowerment Technology
iParol v1 (PHS - STEM)
s.2023
*/
//******************************************
// USE write() in replace to digitalWrite()
// The diagram uses 16x16 matrix. Note that the 16th adress will not work
// This will work with 15x15 boards
//******************************************
#include "MUX_iParol.h"
//ARRAYS FOR LED COLORS
byte purple[]={78,77,91,93,94,106,107,108,121,123,124,137,138,154,170,186,201,217,187,172,218,203,188,219,189,174,205,190,176,162,148,149,135,133,132,120,119,118,105,103,102,89,88,72,56,40,25,9,39,54,8,23,38,7,37,52,21,36,50,64,
97,112,127,128,129,114,99,98,81,96,126,141,142,144,145,130,100,85,84,82};
byte pink[]={92,122,202,204,134,104,24,113,22};
byte green[]={1,15,225,211,31,32,18,3,45,44,28,13,195,194,208,223,181,182,198,213};
byte yellow[]={109,110,111,143,158,173,117,116,115,53,68,83,139,140,155,156,171,175,160,161,146,147,55,70,71,86,87,79,80,65,66,51,
16,17,2,196,197,212,224,209,210,14,29,30,46,47,33,19,4,166,167,183,199,214,222,207,193,179,180,12,27,43,59,60};
byte white[]={95,125,157,159,131,101,69,67};
byte red[]={6,5,20,35,34,49,48,63,62,61,76,136,151,152,153,168,169,184,185,200,215,216,220,221,206,191,192,177,178,163,164,165,150,90,75,74,73,58,57,42,41,26,11,10};
byte con1[]={127,128,129,114,99,98,97,112};
byte con2[]={141,142,143,144,145,130,115,100,85,84,83,82,81,96,111,126};
byte con3[]={155,156,157,158,159,160,161,146,131,116,101,86,71,70,69,68,67,66,65,80,95,110,125,140};
byte con4[]={169,170,171,172,173,174,175,176,177,162,147,132,117,102,87,72,57,
56,55,54,53,52,51,50,49,64,79,94,109,124,139,154};
byte con5[]={183,184,185,186,187,188,189,190,191,192,193,178,163,148,133,118,103,88,73,58,43,
42,41,40,39,38,37,36,35,34,33,48,63,78,93,108,123,138,153,168};
byte con6[]={197,198,199,200,201,202,203,204,205,206,207,208,209,194,179,164,149,134,119,104,89,74,59,44,29,
28,27,26,25,24,23,22,21,20,19,18,17,32,47,62,77,92,107,122,137,152,167,182};
byte con7[]={211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,
210,195,180,165,150,135,120,105,90,75,60,45,30,15,
14,13,12,11,10,9,8,7,6,5,4,3,2,1,16,31,46,61,76,91,106,121,136,151,166,181,196,211};
byte cornerTR[]={211,196,197,212,181,182,198,213,166,167,183,199,214,136,151,152,153,168,169,184,185,200,215,216};
byte cornerTL[]={1,16,17,2,31,32,18,3,46,47,33,19,4,76,61,62,63,48,49,34,35,20,5,6};
byte cornerBL[]={15,14,29,30,13,28,44,45,12,27,43,59,60,10,11,26,41,42,57,58,73,74,75,90};
byte cornerBR[]={225,224,209,210,223,208,194,195,222,207,193,179,180,220,221,206,191,192,177,178,163,164,165,150};
byte middle[]={113,97,112,127,98,128,99,114,129,81,96,111,126,141,82,142,83,143,84,144,85,100,115,130,145,64,94,124,154,50,95,125,170,52,67,157,172,54,69,159,174,56,101,131,176,72,102,132,162};
byte purp_mid[]={81,82,84,85,96,97,98,99,100,112,114,126,127,128,129,130,141,142,144,145, 113};
byte outer_middle[]={77,92,107,122,137,78,93,108,123,138,25,24,23,22,21,40,39,38,37,36,205,204,203,202,201,190,189,188,187,186,89,104,119,134,149,88,103,118,133,148};
byte middle_yellow[]={51,65,79,109,139,155,171,173,175,161,147,117,87,71,55,53,66,80,110,140,156,158,160,146,116,86,70,68,83,111,143,115};
byte middle_face[]={97,127,99,114,129,82,142,84,85,144,145,64,94,124,154,170,172,174,176,162,132,102,72,56,54,52,50};
byte yellow_face[]={79,139,55,71,87,117,147,161,175, 80,140, 16,17,2,196,197,212,14,29,30,210,209,224, 4,19,33,47,46,166,167,183,199,214,12,27,43,59,60,222,207,193,179,180};
byte face2[]={66,65,80,156,155,140,68,53,54,55,71,87,102,117,132,147,161,175,174,173,158, 83,143, 98,128, 113,50,64,154,170};
byte jellyfish[]={77,78,91,92,93,94,106,107,108,121,122,123,124,137,138, 201,186,217,202,187,172,218,203,188,219,204,189,174,205,190, 149,148,135,134,133,132,120,119,118,105,104,103,102,89,88, 25,40,9,24,39,54,8,23,38,7,22,37,52,21,36};
byte left_jelly[]={25,40,9,24,39,54,8,23,38,7,22,37,52,21,36};
byte yellow_midthing[]={110,68,116,158,109,53,117,173, 139,51,87,175, 80,65,66,70,71,86,146,161,160,156,155,140, 79,55,147,171};
byte purple_border[]={78,186,148,40,77,201,149,25, 25,40,9,24,39,54,69,64,8,23,38,77,78,91,92,93,94,95,106,107,108,186,201,157,172,187,202,217,188,203,218,148,149,131,132,133,134,135,118,119,120,50,72,176,154, 21,36,7,22,37,52,67,121,122,123,124,125,137,138,159,174,189,204,219,190,205,101,102,103,104,105,88,89,64,56,170,162};
byte red_border[]={6,5,136,151,220,221,75,90, 20,35,152,153,206,191,74,73, 34,49,168,169,192,177,58,57, 48,63,184,185,178,163,42,41, 62,61,200,215,164,165,26,11, 76,216,150,10};
byte yellow_border[]={4,19,166,167,222,207,59,60, 33,47,199,183,193,179,43,27, 46,3,181,214,223,180,45,12, 18,32,182,198,208,194,44,28, 31,2,213,196,195,224,13,30, 16,17,197,212,14,29,209,210, 1,211,225,15};
byte jadl[]={1,16,31,46,61,76,91,106,121,136,151,166,181,196,211}; //array ni raven wag burahin
byte jan[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
//#####################################################################################
void setup() {
iParol_Init();
}
void loop() {
//SEQUENCE 1 START ###################################################
delay(4000);
purple_state(0,13,1,HIGH,0);
delay(480);
purple_state(15,28,1,HIGH,0);
delay(480);
purple_state(30,43,1,HIGH,0);
delay(480);
purple_state(45,58,1,HIGH,0);
delay(480);
purple_state(13,15,1,HIGH,0);
delay(480);
purple_state(28,30,1,HIGH,0);
delay(480);
purple_state(43,45,1,HIGH,0);
delay(480);
purple_state(58,60,1,HIGH,0);
delay(480);
pink_state(7,8,1,HIGH,0);
delay(480);
purple_state(60,68,1,HIGH,0);
delay(480);
purple_state(68,80,1,HIGH,0);
delay(480);
for(byte i=1; i<4; i++)
{
pink_state(0,9,1,HIGH,0);
delay(480);
pink_state(0,9,1,LOW,0);
byte mamamo = i;
delay(480);
}
green_state(0,20,1,HIGH,0);
delay(480);
yellow_state(0,64,1,HIGH,0);
delay(480);
white_state(0,8,1,HIGH,0);
delay(480);
red_state(0,44,1,HIGH,0);
delay(480);
pink_state(0,9,1,HIGH,0);
delay(480);
reusableloop(0,226,1,LOW,0);
zoom_state1(HIGH,0,25);
reusableloop(1,226,1,LOW,0);
zoom_state1(HIGH,100,0);
zoom_state(LOW,100,0);
reusableloop(1,226,1,HIGH,0);
delay(200);
reusableloop(1,226,1,LOW,0);
delay(200);
reusableloop(225,226,-1,HIGH,0);
delay(200);
reusableloop(225,226,-1,LOW,0);
purple_state(0,80,1,HIGH,0);
delay(200);
purple_state(0,80,1,LOW,0);
red_state(0,44,1,HIGH,0);
delay(200);
red_state(0,44,1,LOW,0);
yellow_state(0,64,1,HIGH,0);
delay(200);
yellow_state(0,64,1,LOW,0);
green_state(0,20,1,HIGH,0);
delay(200);
yellow_state(0,64,1,HIGH,0);
delay(200);
red_state(0,44,1,HIGH,0);
delay(200);
purple_state(0,80,1,HIGH,0);
delay(200);
white_state(0,8,1,HIGH,0);
delay(200);
pink_state(0,9,1,HIGH,0);
delay(200);
reusableloop(225,226,-1,LOW,0);
zoom_state(HIGH, 100,0);
zoom_state(LOW, 100,0);
purple_state(0,80,1,HIGH,0);
green_state(0,20,1,HIGH,0);
pink_state(0,9,1,HIGH,0);
delay(200);
purple_state(0,80,1,LOW,0);
green_state(0,20,1,LOW,0);
pink_state(0,9,1,LOW,0);
yellow_state(0,64,1,HIGH,0);
red_state(0,44,1,HIGH,0);
delay(200);
yellow_state(0,64,1,LOW,0);
red_state(0,44,1,LOW,0);
white_state(0,8,1,HIGH,0);
green_state(0,20,1,HIGH,0);
pink_state(0,9,1,HIGH,0);
delay(200);
green_state(0,20,1,LOW,0);
pink_state(0,9,1,LOW,0);
delay(50);
zoom_state(HIGH, 100,0);
zoom_state(LOW, 100,0);
//SEQUENCE 1 END ###################################################
//SEQUENCE 2 START #################################################
//SEQUENCE 2 END ###################################################
//SEQUENCE 3 START #################################################
for(byte a=0; a<5; a++){
zoom_state(HIGH,0,0);
delay(100);
zoom_state(LOW,0,0);
delay(100);
}
for(byte a=0; a<1; a++){
write(cornerTR[a], HIGH);
delay(200);
for(byte a=1; a<4; a++){write(cornerTR[a], HIGH);}
delay(200);
for(byte a=4; a<8; a++){write(cornerTR[a], HIGH);}
delay(200);
for(byte a=8; a<13; a++){write(cornerTR[a], HIGH);}
delay(200);
for(byte a=13; a<24; a++){write(cornerTR[a], HIGH);}
}
delay(200);
for(byte a=0; a<1; a++){
write(cornerBR[a], HIGH);
delay(200);
for(byte a=1; a<4; a++){write(cornerBR[a], HIGH);}
delay(200);
for(byte a=4; a<8; a++){write(cornerBR[a], HIGH);}
delay(200);
for(byte a=8; a<13; a++){write(cornerBR[a], HIGH);}
delay(200);
for(byte a=13; a<24; a++){write(cornerBR[a], HIGH);}
}
delay(200);
for(byte a=0; a<1; a++){
write(cornerBL[a], HIGH);
delay(200);
for(byte a=1; a<4; a++){write(cornerBL[a], HIGH);}
delay(200);
for(byte a=4; a<8; a++){write(cornerBL[a], HIGH);}
delay(200);
for(byte a=8; a<13; a++){write(cornerBL[a], HIGH);}
delay(200);
for(byte a=13; a<24; a++){write(cornerBL[a], HIGH);}
}
delay(200);
for(byte a=0; a<1; a++){
write(cornerTL[a], HIGH);
delay(200);
for(byte a=1; a<4; a++){write(cornerTL[a], HIGH);}
delay(200);
for(byte a=4; a<8; a++){write(cornerTL[a], HIGH);}
delay(200);
for(byte a=8; a<13; a++){write(cornerTL[a], HIGH);}
delay(200);
for(byte a=13; a<24; a++){write(cornerTL[a], HIGH);}
}
delay(200);
for(byte a=0; a<2; a++){
allcorners(LOW);
delay(200);
allcorners(HIGH);
}
purple_state(0, 60, 1, HIGH, 0);
delay(200);
purple_state(0, 60, 1, LOW, 0);
delay(200);
purple_state(0, 60, 1, HIGH, 0);
yellow_state(0, 64, 1, HIGH, 0);
white_state(0, 8, 1, HIGH, 0);
pink_state(0, 9, 1, HIGH, 0);
delay(200);
zoom_state(LOW, 0, 0);
delay(200);
zoom_state(HIGH, 0, 0);
for(byte a=0; a<1; a++){
write(cornerTR[a], LOW);
write(cornerBR[a], LOW);
write(cornerTL[a], LOW);
write(cornerBL[a], LOW);
delay(200);
for(byte a=1; a<4; a++){write(cornerTR[a], LOW); write(cornerBR[a], LOW); write(cornerBL[a], LOW); write(cornerTL[a], LOW);}
delay(200);
for(byte a=4; a<8; a++){write(cornerTR[a], LOW); write(cornerBR[a], LOW); write(cornerBL[a], LOW); write(cornerTL[a], LOW);}
delay(200);
for(byte a=8; a<13; a++){write(cornerTR[a], LOW); write(cornerBR[a], LOW); write(cornerBL[a], LOW); write(cornerTL[a], LOW);}
delay(200);
for(byte a=13; a<24; a++){write(cornerTR[a], LOW); write(cornerBR[a], LOW); write(cornerBL[a], LOW); write(cornerTL[a], LOW);}
}
for(byte a=0; a<1; a++){
write(middle[a], LOW);
delay(200);
for(byte a=1; a<9; a++){write(middle[a], LOW);}
delay(200);
for(byte a=9; a<25; a++){write(middle[a], LOW);}
}
delay(200);
yellow_state(0, 64, 1, LOW, 0);
delay(200);
for(byte a=25; a<50; a++){write(middle[a], LOW);}
delay(200);
for(byte a=0; a<40; a++){write(outer_middle[a], LOW);}
delay(200);
purple_state(0, 60, 1, HIGH, 0);
pink_state(0, 9, 1, HIGH, 0);
for(byte a=0; a<9; a++){write(middle[a], LOW);}
delay(200);
for(byte a=26; a<49; a++){write(middle[a], HIGH);}
delay(200);
white_state(0, 8, 1, HIGH, 0);
for(byte a=0; a<16; a++){write(middle_yellow[a], HIGH);}
delay(200);
for(byte a=16; a<32; a++){write(middle_yellow[a], HIGH);}
delay(200);
for(byte a=1; a<26; a++){write(middle[a], HIGH);}
delay(200);
pink_state(0, 9, 1, HIGH, 0);
red_state(0, 44, 1, HIGH, 0);
delay(200);
for(byte a=8; a<13; a++){write(cornerTR[a], HIGH); write(cornerBR[a], HIGH); write(cornerBL[a], HIGH); write(cornerTL[a], HIGH);}
delay(200);
for(byte a=4; a<8; a++){write(cornerTR[a], HIGH); write(cornerBR[a], HIGH); write(cornerBL[a], HIGH); write(cornerTL[a], HIGH);}
delay(200);
for(byte a=0; a<4; a++){write(cornerTR[a], HIGH); write(cornerBR[a], HIGH); write(cornerBL[a], HIGH); write(cornerTL[a], HIGH);}
delay(200);
zoom_state(LOW,0,0);
delay(100);
zoom_state(HIGH,0,0);
delay(100);
green_state(0, 20, 1, LOW, 0);
delay(200);
green_state(0, 20, 1, HIGH, 0);
delay(200);
yellow_state(0, 64, 1, LOW, 0);
delay(200);
yellow_state(0, 64, 1, HIGH, 0);
delay(200);
red_state(0, 44, 1, LOW, 0);
delay(200);
red_state(0, 44, 1, HIGH, 0);
delay(200);
pink_state(0, 9, 1, LOW, 0);
delay(200);
pink_state(0, 9, 1, HIGH, 0);
delay(200);
white_state(0, 8, 1, LOW, 0);
delay(200);
zoom_state(LOW,0,0);
delay(200);
for(byte a=0; a<11; a++){write(middle_face[a], HIGH);}
delay(200);
for(byte a=0; a<27; a++){write(middle_face[a], HIGH);}
delay(200);
for(byte a=5; a<27; a++){write(middle_face[a], LOW);}
delay(200);
zoom_state(LOW,0,0);
delay(200);
for(byte a=0; a<9; a++){write(yellow_face[a], HIGH);}
for(byte a=11; a<43; a++){write(yellow_face[a], HIGH);}
delay(200);
for(byte a=11; a<23; a++){write(yellow_face[a], LOW);}
for(byte a=9; a<11; a++){write(yellow_face[a], HIGH);}
delay(200);
for(byte a=0; a<43; a++){write(yellow_face[a], LOW);}
for(byte a=9; a<11; a++){write(yellow_face[a], HIGH);}
delay(200);
for(byte a=9; a<11; a++){write(yellow_face[a], LOW);}
delay(200);
for(byte a=0; a<4; a++){write(cornerTR[a], HIGH); write(cornerBR[a], HIGH); write(cornerBL[a], HIGH); write(cornerTL[a], HIGH);}
delay(200);
for(byte a=4; a<8; a++){write(cornerTR[a], HIGH); write(cornerBR[a], HIGH); write(cornerBL[a], HIGH); write(cornerTL[a], HIGH);}
for(byte a=8; a<13; a++){write(cornerTR[a], HIGH); write(cornerBR[a], HIGH); write(cornerBL[a], HIGH); write(cornerTL[a], HIGH);}
delay(200);
for(byte a=13; a<24; a++){write(cornerTR[a], HIGH); write(cornerBR[a], HIGH); write(cornerBL[a], HIGH); write(cornerTL[a], HIGH);}
for(byte a=0; a<21; a++){write(face2[a],HIGH);}
delay(200);
for(byte a=21; a<23; a++){write(face2[a],HIGH);}
delay(200);
for(byte a=23; a<25; a++){write(face2[a],HIGH);}
delay(200);
for(byte a=25; a<30; a++){write(face2[a],HIGH);}
delay(2000);
column(LOW, 20, 15);
for(byte a=0; a<60; a++){write(jellyfish[a], HIGH); write(jellyfish[a-10], LOW); delay(75);
}
for(byte a=0; a<15; a++){write(left_jelly[a], HIGH);}
delay(200);
column(LOW, 75, 4);
for(byte a=0; a<21; a++){write(purp_mid[a], HIGH); delay(50);} delay(200);
for(byte a=0; a<25; a++){write(middle[a], HIGH);} delay(200);
for(byte a=0; a<8; a++){write(yellow_midthing[a], HIGH);} delay(200);
for(byte a=8; a<12; a++){write(yellow_midthing[a], HIGH);} delay(200);
for(byte a=12; a<24; a++){write(yellow_midthing[a], HIGH);} delay(200);
for(byte a=24; a<28; a++){write(yellow_midthing[a], HIGH);} delay(200);
for(byte a=0; a<8; a++){write(purple_border[a], HIGH);} delay(200);
for(byte a=8; a<53; a++){write(purple_border[a], HIGH);} delay(200);
for(byte a=53; a<85; a++){write(purple_border[a], HIGH);} delay(200);
for(byte j=0; j<33; j=j+8){
for(byte a=j; a<j+8; a++){write(red_border[a], HIGH);} delay(200);
}
for(byte a=40; a<44; a++){write(red_border[a], HIGH);} delay(200);
for(byte j=0; j<41; j=j+8){
for(byte a=j; a<j+8; a++){write(yellow_border[a], HIGH);} delay(200);
}
for(byte a=48; a<52; a++){write(yellow_border[a], HIGH);} delay(200);
for(byte a=48; a<52; a++){write(yellow_border[a], LOW);} delay(200);
for(int j=39; j>-2; j=j-8){
for(int a=j+8; a>j; a--){write(yellow_border[a], LOW);} delay(200);
}
for(byte a=40; a<44; a++){write(red_border[a], LOW);} delay(200);
for(int j=31; j>-2; j=j-8){
for(int a=j+8; a>j; a--){write(red_border[a], LOW);} delay(200);
}
for(byte a=53; a<85; a++){write(purple_border[a], LOW);} delay(200);
for(byte a=8; a<53; a++){write(purple_border[a], LOW);} delay(200);
for(byte a=0; a<8; a++){write(purple_border[a], LOW);} delay(200);
for(byte a=24; a<28; a++){write(yellow_midthing[a], LOW);} delay(200);
for(byte a=12; a<24; a++){write(yellow_midthing[a], LOW);} delay(200);
for(byte a=8; a<12; a++){write(yellow_midthing[a], LOW);} delay(200);
for(byte a=0; a<8; a++){write(yellow_midthing[a], LOW);} delay(200);
for(byte a=1; a<25; a++){write(middle[a], LOW);} delay(200);
write(113, LOW); delay(200);
zoom_state1(HIGH, 200, 0); delay(200);
zoom_state1(LOW, 200, 0); delay(200);
row(HIGH, 50, 15);
zoom_state(LOW, 0, 0); delay(200);
zoom_state(HIGH, 0, 0); delay(200);
zoom_state(LOW, 0, 0); delay(200);
purple_state(0, 80, 1, HIGH, 0); delay(200);
purple_state(0, 80, 1, LOW, 0); delay(200);
red_state(0, 44, 1, HIGH, 0); delay(200);
red_state(0, 44, 1, LOW, 0); delay(200);
yellow_state(0, 64, 1, HIGH, 0); delay(200);
yellow_state(0, 64, 1, LOW, 0); delay(200);
yellow_state(0, 64, 1, HIGH, 0); delay(200);
red_state(0, 44, 1, HIGH, 0); delay(200);
write(1, HIGH); write(211, HIGH); write(15, HIGH); write(225, HIGH); delay(200);
green_state(0, 20, 1, HIGH, 0); delay(200);
purple_state(0, 80, 1, HIGH, 0); delay(200);
pink_state(0, 9, 1, HIGH, 0); delay(200);
white_state(0, 8, 1, HIGH, 0); delay(200);
zoom_state(LOW, 0, 0); delay(200);
zoom_state(HIGH, 0, 0); delay(200);
zoom_state(LOW, 0, 0); delay(200);
zoom_state(HIGH, 0, 0); delay(200);
zoom_state(LOW, 0, 0); delay(200);
//SEQUENCE 3 END ###################################################
//SEQUENCE 4 START #################################################
rows1(HIGH);
reusableloop(0,226,1,LOW,0);
delay(200);
reusableloop(0,226,1,HIGH,0);
delay(200);
reusableloop(1,226,1,LOW,0);
delay(200);
purple_state(0,80,1,HIGH,0);
pink_state(0,9,1,HIGH,0);
green_state(0,20,1,HIGH,0);
white_state(0,8,1,HIGH,0);
delay(300);
reusableloop(0,226,1,LOW,0);
white_state(0,8,1,HIGH,0);
red_state(0,44,1,HIGH,0);
yellow_state(0,64,1,HIGH,0);
delay(300);
reusableloop(0,226,1,LOW,0);
purple_state(0,80,1,HIGH,0);
pink_state(0,9,1,HIGH,0);
white_state(0,8,1,HIGH,0);
yellow_state(0,32,1,HIGH,0);
delay(300);
reusableloop(0,226,1,LOW,0);
purple_state(0,80,1,HIGH,0);
reusableloop(0,226,1,LOW,0);
yellow_state(0,64,1,HIGH,0);
delay(300);
reusableloop(0,226,1,LOW,0);
red_state(0,44,1,HIGH,0);
delay(300);
reusableloop(0,226,1,LOW,0);
pink_state(0,9,1,HIGH,0);
white_state(0,8,1,HIGH,0);
green_state(0,20,1,HIGH,0);
delay(300);
reusableloop(0,226,1,LOW,0);
zoom_state(HIGH, 100,0);
delay(200);
reusableloop(0,226,1,LOW,0);
delay(500);
reusableloop(0,226,1,HIGH,0);
delay(200);
reusableloop(0,226,1,LOW,0);
delay(200);
reusableloop(0,226,1,HIGH,0);
delay(200);
donut_state(LOW, 500,0);
delay(400);
red_state(5,44,11,LOW,0);
delay(500);
purple_state(0,80,1,LOW,0);
white_state(0,8,1,LOW,0);
delay(400);
reusableloop(0,226,1,LOW,0);
white_state(0,8,1,HIGH,0);
delay(200);
pink_state(7,8,1,HIGH,0);
delay(200);
pink_state(7,8,1,LOW,0);
delay(200);
pink_state(0,9,1,HIGH,0);
delay(200);
pink_state(0,9,1,LOW,0);
delay(200);
white_state(0,8,1,LOW,0);
delay(200);
reusableloop(0,226,1,HIGH,0);
delay(300);
reverse_donut(LOW, 300,0);
delay(300);
donut_state1(HIGH, 300,0);
delay(200);
reusableloop(0,226,1,LOW,0);
reusableloop(0,226,1,HIGH,0);
delay(200);
reusableloop(0,226,1,LOW,0);
reusableloop(0,226,1,HIGH,0);
delay(200);
reusableloop(0,226,1,LOW,0);
reusableloop(0,226,1,HIGH,0);
delay(200);
box7(0,56,1,LOW,0);
delay(200);
box7(0,56,1,HIGH,0);
delay(200);
box6(0,48,1,LOW,0);
delay(200);
box6(0,48,1,HIGH,0);
delay(200);
box5(0,40,1,LOW,0);
delay(200);
box5(0,40,1,HIGH,0);
delay(200);
box4(0,32,1,LOW,0);
delay(200);
box4(0,32,1,HIGH,0);
delay(200);
box3(0,24,1,LOW,0);
delay(200);
box3(0,24,1,HIGH,0);
delay(200);
box2(0,16,1,LOW,0);
delay(200);
box2(0,16,1,HIGH,0);
delay(200);
box1(0,8,1,LOW,0);
delay(200);
box1(0,8,1,HIGH,0);
delay(200);
pink_state(7,8,1,LOW,0);
delay(200);
pink_state(7,8,1,HIGH,0);
delay(200);
reusableloop(0,226,1,LOW,0);
rows2(HIGH);
rows3(LOW);
zoom_state1(HIGH, 100,0);
zoom_state1(LOW, 100,0);
zoom_state(HIGH, 100,0);
delay(200);
zoom_state1(LOW, 100,0);
delay(5000);
//SEQUENCE 4 END ###################################################
}
//REUSABLE FUNCTION FOR EACH LED COLORS ###################################
void zoom_state(bool state, byte inter, byte interval)
{
for(byte i=0; i<1; i++)
{
pink_state(7,8,1,state,0);
delay(inter);
box1(0,8,1,state,interval);
delay(inter);
box2(0,16,1,state,interval);
delay(inter);
box3(0,24,1,state,interval);
delay(inter);
box4(0,32,1,state,interval);
delay(inter);
box5(0,40,1,state,interval);
delay(inter);
box6(0,48,1,state,interval);
delay(inter);
box7(0,56,1,state,interval);
byte joh=i;
}
}
void zoom_state1(bool state, byte inter, byte interval)
{
for(byte i=0; i<1; i++)
{
box7(0,56,1,state,interval);
delay(inter);
box6(0,48,1,state,interval);
delay(inter);
box5(0,40,1,state,interval);
delay(inter);
box4(0,32,1,state,interval);
delay(inter);
box3(0,24,1,state,interval);
delay(inter);
box2(0,16,1,state,interval);
delay(inter);
box1(0,8,1,state,interval);
delay(inter);
pink_state(7,8,1,state,0);
delay(inter);
byte joh = i;
}
}
void zoom_state2(bool state, byte inter, byte interval)
{
for(byte i=0; i<1; i++)
{
pink_state(7,8,1,state,0);
delay(inter);
box1(7,8,1,state,interval);
box1(0,7,1,state,interval);
delay(inter);
box2(13,16,1,state,interval);
box2(0,13,1,state,interval);
delay(inter);
box3(19,24,1,state,interval);
box3(0,19,1,state,interval);
delay(inter);
box4(25,32,1,state,interval);
box4(0,25,1,state,interval);
delay(inter);
box5(31,40,1,state,interval);
box5(0,31,1,state,interval);
delay(inter);
box6(37,48,1,state,interval);
box6(0,37,1,state,interval);
delay(inter);
box7(43,56,1,state,interval);
box7(0,43,1,state,interval);
byte joh=i;
}
}
void purple_state(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(purple[i], state);
delay(interval);
}
}
void pink_state(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(pink[i], state);
delay(interval);
}
}
void green_state(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(green[i], state);
delay(interval);
}
}
void yellow_state(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(yellow[i], state);
delay(interval);
}
}
void white_state(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(white[i], state);
delay(interval);
}
}
void red_state(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(red[i], state);
delay(interval);
}
}
void box1(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(con1[i], state);
delay(interval);
}
}
void box2(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(con2[i], state);
delay(interval);
}
}
void box3(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(con3[i], state);
delay(interval);
}
}
void box4(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(con4[i], state);
delay(interval);
}
}
void box5(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(con5[i], state);
delay(interval);
}
}
void box6(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(con6[i], state);
delay(interval);
}
}
void box7(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(con7[i], state);
delay(interval);
}
}
void purple_spin(bool state, byte inter)
{
purple_state(0,2,1,state,0);
delay(inter);
purple_state(2,5,1,state,0);
delay(inter);
purple_state(5,8,1,state,0);
delay(inter);
purple_state(8,11,1,state,0);
delay(inter);
purple_state(11,13,1,state,0);
delay(inter);
purple_state(15,17,1,state,0);
delay(inter);
purple_state(17,20,1,state,0);
delay(inter);
purple_state(20,23,1,state,0);
delay(inter);
purple_state(23,26,1,state,0);
delay(inter);
purple_state(26,28,1,state,0);
delay(inter);
purple_state(30,32,1,state,0);
delay(inter);
purple_state(32,35,1,state,0);
delay(inter);
purple_state(35,38,1,state,0);
delay(inter);
purple_state(38,41,1,state,0);
delay(inter);
purple_state(41,43,1,state,0);
delay(inter);
purple_state(45,47,1,state,0);
delay(inter);
purple_state(47,50,1,state,0);
delay(inter);
purple_state(50,53,1,state,0);
delay(inter);
purple_state(53,56,1,state,0);
delay(inter);
purple_state(56,58,1,state,0);
delay(inter);
box2(8,13,1,state,0);
write(83,LOW);
delay(inter);
box1(4,7,1,state,0);
box2(7,14,6,state,0);
delay(inter);
box1(3,8,4,state,0);
delay(inter);
box1(0,3,1,state,0);
box2(5,16,10,state,0);
delay(inter);
box2(0,5,1,state,0);
write(143,LOW);
}
//REUSABLE FOR LOOP ########################################################
void reusableloop(byte var, byte con, byte incre, bool state, byte interval)
{
for(byte i=var; i<con; i=i+incre)
{
write(i, state);
delay(interval);
}
}
//##########################################################################
void rows(byte var, byte con, byte incre, bool state, byte interval, byte inter2)
{
for(byte i=var; i<con; i=i+15)
{
write(i, state);
delay(interval);
}
delay(inter2);
}
void rows1(bool state)
{
rows(15,226,1,state,0,50);
rows(14,226,1,state,0,50);
rows(13,226,1,state,0,50);
rows(12,226,1,state,0,50);
rows(11,226,1,state,0,50);
rows(10,226,1,state,0,50);
rows(9,226,1,state,0,50);
rows(8,226,1,state,0,50);
rows(7,226,1,state,0,50);
rows(6,226,1,state,0,50);
rows(5,226,1,state,0,50);
rows(4,226,1,state,0,50);
rows(3,226,1,state,0,50);
rows(2,226,1,state,0,50);
rows(1,226,1,state,0,50);
}
void rows2(bool state)
{
rows(15,226,1,state,0,50);
rows(1,226,1,state,0,50);
rows(14,226,1,state,0,50);
rows(2,226,1,state,0,50);
rows(13,226,1,state,0,50);
rows(3,226,1,state,0,50);
rows(12,226,1,state,0,50);
rows(4,226,1,state,0,50);
rows(11,226,1,state,0,50);
rows(5,226,1,state,0,50);
rows(10,226,1,state,0,50);
rows(6,226,1,state,0,50);
rows(9,226,1,state,0,50);
rows(7,226,1,state,0,50);
rows(8,226,1,state,0,50);
}
void rows3(bool state)
{
rows(8,226,1,state,0,50);
rows(7,226,1,state,0,50);
rows(9,226,1,state,0,50);
rows(6,226,1,state,0,50);
rows(10,226,1,state,0,50);
rows(5,226,1,state,0,50);
rows(11,226,1,state,0,50);
rows(4,226,1,state,0,50);
rows(12,226,1,state,0,50);
rows(3,226,1,state,0,50);
rows(13,226,1,state,0,50);
rows(2,226,1,state,0,50);
rows(14,226,1,state,0,50);
rows(1,226,1,state,0,50);
rows(15,226,1,state,0,50);
}
void donut_state(bool state, byte inter, byte interval)
{
for(byte i=0; i<1; i++)
{
pink_state(7,8,1,state,0);
box7(0,56,1,state,interval);
delay(inter);
box1(0,8,1,state,interval);
box6(0,48,1,state,interval);
delay(inter);
box2(0,16,1,state,interval);
box5(0,40,1,state,interval);
}
}
void donut_state1(bool state, byte inter, byte interval)
{
for(byte i=0; i<1; i++)
{
pink_state(7,8,1,state,0);
box7(0,56,1,state,interval);
delay(inter);
box1(0,8,1,state,interval);
box6(0,48,1,state,interval);
delay(inter);
box2(0,16,1,state,interval);
box5(0,40,1,state,interval);
delay(inter);
box3(0,24,1,state,interval);
box4(0,32,1,state,interval);
}
}
void reverse_donut(bool state, byte inter, byte interval)
{
for(byte i=0; i<1; i++)
{
box3(0,24,1,state,interval);
box4(0,32,1,state,interval);
delay(inter);
box2(0,16,1,state,interval);
box5(0,40,1,state,interval);
delay(inter);
box1(0,8,1,state,interval);
box6(0,48,1,state,interval);
delay(inter);
pink_state(7,8,1,state,0);
box7(0,56,1,state,interval);
}
}
void allcorners(bool state){
for(byte a=0; a<24; a++){
write(cornerTR[a], state);
write(cornerTL[a], state);
write(cornerBR[a], state);
write(cornerBL[a], state);
}
}
void row(bool state, byte num, byte ja){
for(int a = 0; a < ja; a++){
delay(num);
for(int b = 0; b < 225; b=b+15){
write(jan[a]+b, state);
}
}
}
void column(bool state, byte num, byte ja){
for(int a = 0; a < ja; a++){
delay(num);
for(int b = 0; b < 15; b++){
write(jadl[a]+b, state);
}
}
}