Tilt sensor shut off LED?

Hey guys, so im working on a project in which an ultrasonic sensor detects an object in range, and switches on an led. I also have a tilt switch (The one with the metal ball) and whenever that moves it sets of a diffrent LED ( i will refer to this as LED2). Is there anyway I can make the switch turn off LED 1? Please help me, thank you!

This is the code

const int trigPin = 7;
const int echoPin = 8;
const int uvLed = 6;

int Emergency = 9;
int sensorPin = 2;
int sensorValue;
int LastTiltState = HIGH;

long duration;
int distance;
int safteyDistance;

long lastDebounceTime = 0;
long debounceDelay = 50;
void setup(){
pinMode(sensorPin, INPUT);
digitalWrite(sensorPin,HIGH);
pinMode(Emergency, OUTPUT);
Serial.begin(9600);

pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(uvLed, OUTPUT);
Serial.begin(9600);
}

void loop() {
sensorValue = digitalRead(sensorPin);
if (sensorValue == LastTiltState) {
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
LastTiltState = sensorValue;
digitalWrite(uvLed, LOW);
}
digitalWrite(Emergency, LastTiltState);

Serial.println(sensorValue);
delay(500);

digitalWrite(trigPin, LOW);
delayMicroseconds(2);

digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance= duration*0.034/2;

safteyDistance = distance;
if (safteyDistance <= 10){
digitalWrite(uvLed, HIGH);
}
else{
digitalWrite(uvLed, LOW);

}
Serial.print("Distance: ");
Serial.println(distance);

}

Please use code tags when posting code.

If digitalWrite(Led, LOW) turns ON the LED, then use digitalWrite(Led, HIGH) to turn it off. Or vice versa.

jremington:
Please use code tags when posting code.

If digitalWrite(Led, LOW) turns ON the LED, then use digitalWrite(Led, HIGH) to turn it off. Or vice versa.

Yes, i know that, its just the placement in the code i dont understand.

The code makes no reference to "LED 1" or "LED2".

jremington:
The code makes no reference to "LED 1" or "LED2".

re read the post, but in code led1 is uvLed and led2 is Emergency

If you edit your post to put the code in code tags and put a few //explainations after each bit of code it will be a lot easier to read for you as well as anyone helping. Also hit the auto format in the ide