PIR to relay

Hi all

im new to arduino so looking for some help

i have a 14 way relay (16 way module but only using 14) set up to control some lights and currently when the PIR is triggered it turns on the 14 relays starting from 1 to 14 with a short delay between each relay been switch on, what i would like to do is add a second PIR that will trigger the relays backwards from 14 to 1

below is my cade

int UPmotionPin = A5; // Pin of IR Motion Sensor

#define RELAY1 2
#define RELAY2 3
#define RELAY3 4
#define RELAY4 5
#define RELAY5 6
#define RELAY6 7
#define RELAY7 8
#define RELAY8 9
#define RELAY9 10
#define RELAY10 11
#define RELAY11 12
#define RELAY12 13
#define RELAY13 A0
#define RELAY14 A1

void setup() {
Serial.begin(9600);
pinMode(RELAY1, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY1, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY2, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY2, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY3, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY3, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY4, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY4, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY5, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY5, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY6, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY6, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY7, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY7, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY8, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY8, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY9, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY9, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY10, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY10, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY11, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY11, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY12, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY12, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY13, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY13, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(RELAY14, OUTPUT); // Set Pin connected to Relay as an OUTPUT
digitalWrite(RELAY14, LOW); // Set Pin to LOW to turn Relay OFF

pinMode(UPmotionPin, INPUT); // declare sensor 1 as input

}

void loop() {

while (digitalRead(UPmotionPin) == HIGH) { // If Motion detected
digitalWrite(RELAY1, LOW); // Turn Relay ON
Serial.println("Step 1 is ON");
delay(200);

digitalWrite(RELAY2, LOW); // Turn Relay ON
Serial.println("Step 2 is ON");
delay(200);

digitalWrite(RELAY3, LOW); // Turn Relay ON
Serial.println("Step 3 is ON");
delay(200);

digitalWrite(RELAY4, LOW); // Turn Relay ON
Serial.println("Step 4 is ON");
delay(200);

digitalWrite(RELAY5, LOW); // Turn Relay ON
Serial.println("Step 5 is ON");
delay(200);

digitalWrite(RELAY6, LOW); // Turn Relay ON
Serial.println("Step 6 is ON");
delay(200);

digitalWrite(RELAY7, LOW); // Turn Relay ON
Serial.println("Step 7 is ON");
delay(200);

digitalWrite(RELAY8, LOW); // Turn Relay ON
Serial.println("Step 8 is ON");
delay(200);

digitalWrite(RELAY9, LOW); // Turn Relay ON
Serial.println("Step 9 is ON");
delay(200);

digitalWrite(RELAY10, LOW); // Turn Relay ON
Serial.println("Step 10 is ON");
delay(200);

digitalWrite(RELAY11, LOW); // Turn Relay ON
Serial.println("Step 11 is ON");
delay(200);

digitalWrite(RELAY12, LOW); // Turn Relay ON
Serial.println("Step 12 is ON");
delay(200);

digitalWrite(RELAY13, LOW); // Turn Relay ON
Serial.println("Step 13 is ON");
delay(200);

digitalWrite(RELAY14, LOW); // Turn Relay ON
Serial.println("Step 14 is ON");
delay(200);

}
delay (2000);

digitalWrite(RELAY1, HIGH); // Turn Relay OFF
Serial.println("Step 1 is OFF");
delay(500);
digitalWrite(RELAY2, HIGH); // Turn Relay OFF
Serial.println("Step 2 is OFF");
delay(500);
digitalWrite(RELAY3, HIGH); // Turn Relay OFF
Serial.println("Step 3 is OFF");
delay(500);
digitalWrite(RELAY4, HIGH); // Turn Relay OFF
Serial.println("Step 4 is OFF");
delay(500);
digitalWrite(RELAY5, HIGH); // Turn Relay OFF
Serial.println("Step 5 is OFF");
delay(500);
digitalWrite(RELAY6, HIGH); // Turn Relay OFF
Serial.println("Step 6 is OFF");
delay(500);
digitalWrite(RELAY7, HIGH); // Turn Relay OFF
Serial.println("Step 7 is OFF");
delay(500);
digitalWrite(RELAY8, HIGH); // Turn Relay OFF
Serial.println("Step 8 is OFF");
delay(500);
digitalWrite(RELAY9, HIGH); // Turn Relay OFF
Serial.println("Step 9 is OFF");
delay(500);
digitalWrite(RELAY10, HIGH); // Turn Relay OFF
Serial.println("Step 10 is OFF");
delay(500);
digitalWrite(RELAY11, HIGH); // Turn Relay ON
Serial.println("Step 11 is OFF");
delay(500);
digitalWrite(RELAY12, HIGH); // Turn Relay ON
Serial.println("Step 12 is OFF");
delay(500);
digitalWrite(RELAY13, HIGH); // Turn Relay ON
Serial.println("Step 13 is OFF");
delay(500);
digitalWrite(RELAY14, HIGH); // Turn Relay ON
Serial.println("Step 14 is OFF");
delay(500);

}

First: use code tags to post code! (the </> button in the editor)

Second: learn to use arrays! The whole code will shrink by about 80%.