void setup()
{
pinMode(22, OUTPUT);
pinMode(23, OUTPUT);
pinMode(24, OUTPUT);
pinMode(25, OUTPUT);
pinMode(26, OUTPUT);
pinMode(27, OUTPUT);
pinMode(28, OUTPUT);
pinMode(29, OUTPUT);
pinMode(30, OUTPUT);
pinMode(31, OUTPUT);
pinMode(32, OUTPUT);
pinMode(33, OUTPUT);
pinMode(34, OUTPUT);
pinMode(35, OUTPUT);
pinMode(36, OUTPUT);
pinMode(37, OUTPUT);
pinMode(38, OUTPUT);
pinMode(39, OUTPUT);
pinMode(40, OUTPUT);
pinMode(41, OUTPUT);
pinMode(42, OUTPUT);
pinMode(43, OUTPUT);
pinMode(44, OUTPUT);
pinMode(45, OUTPUT);
pinMode(46, OUTPUT);
pinMode(47, OUTPUT);
pinMode(48, OUTPUT);
pinMode(49, OUTPUT);
pinMode(50, OUTPUT);
pinMode(51, OUTPUT);
}
void cycleIncrementi(){ // CW Cyle
for (int i = 22; i <= 36; i++){
digitalWrite(i, HIGH);
delay(200);
digitalWrite(i, LOW);
}
}
void cycleIncrementj(){ // CW Cyle
for (int j = 37; j <= 51; j++){
digitalWrite(j, HIGH);
delay(200);
digitalWrite(j, LOW);
}
}
void cycleDecrementi(){ // CW Cyle
for (int i = 36; i <= 22; i--){
digitalWrite(i, HIGH);
delay(200);
digitalWrite(i, LOW);
}
}
void cycleDecrementj(){ // CW Cyle
for (int j = 51; j <= 37; j--){
digitalWrite(j, HIGH);
delay(200);
digitalWrite(j, LOW);
}
}
void dualcycle(){ // CW Cyle
for (int j = 51; j >= 37; j--)
for (int i = 22; i <= 36; i++)
{
digitalWrite(i, HIGH);
digitalWrite(j, HIGH);
delay(200);
digitalWrite(i, LOW);
digitalWrite(j, LOW);
delay(200);
}
}
void loop() {
dualcycle();
}