Naivgation for thro echolocation(3 sensors)

When I try to impliment the program the serial monitor shows output properly while the LEDs do not glow at all…can someone help?

Programming all three sensors

#define trigPin1 9
#define echoPin1 8
#define trigPin2 7
#define echoPin2 6
#define trigPin3 4
#define echoPin3 3
#define ledPin1 10
#define ledPin2 11
#define ledPin3 12
long duration, distance, BottomSensor,CentreSensor,TopSensor;
void setup()
{
Serial.begin (9600);
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPin2, OUTPUT);
pinMode(echoPin2, INPUT);
pinMode(trigPin3, OUTPUT);
pinMode(echoPin3, INPUT);
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
}
void loop() {
SonarSensor(trigPin1, echoPin1);
BottomSensor = duration;
SonarSensor(trigPin2, echoPin2);
CentreSensor = duration;
SonarSensor(trigPin3, echoPin3);
TopSensor = duration;
ledTOF();
Serial.print(BottomSensor);
Serial.print(” – “);
Serial.print(CentreSensor);
Serial.print(” – “);
Serial.println(TopSensor);
}
void SonarSensor(int trigPin,int echoPin)
{
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
}
void ledTOF(){
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin2,LOW);
digitalWrite(ledPin3,LOW);
//000
if((BottomSensor>6500) && (CentreSensor>3700) && (TopSensor<3700 &&  TopSensor>6900)){
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin2,LOW);
digitalWrite(ledPin3,LOW);
}
//001
else if((BottomSensor>6500) && (CentreSensor>3700) && (TopSensor>=3700 &&  
TopSensor<=6900)){
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin2,LOW);
digitalWrite(ledPin3,HIGH);
}
//010
else if((BottomSensor>6500) && (CentreSensor<=3700) && (TopSensor<3700 &&  
TopSensor>6900)){
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin2,HIGH);
digitalWrite(ledPin3,LOW);
}
//011
else if((BottomSensor>6500) && (CentreSensor<=3700) && (TopSensor>=3700 &&  
TopSensor<=6900)){
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin2,HIGH);
digitalWrite(ledPin3,HIGH);
}
//100
else if((BottomSensor<=6500) && (CentreSensor>3700) && (TopSensor<3700 &&  
TopSensor>6900)){
digitalWrite(ledPin1,HIGH);
digitalWrite(ledPin2,LOW);
digitalWrite(ledPin3,LOW);
}
//101
else if((BottomSensor<=6500) && (CentreSensor>3700) && (TopSensor>=3700 &&  
TopSensor<=6900)){
digitalWrite(ledPin1,HIGH);
digitalWrite(ledPin2,LOW);
digitalWrite(ledPin3,HIGH);
}
//110
else if((BottomSensor<=6500) && (CentreSensor<=3700) && (TopSensor<3700 &&  
TopSensor>6900)){
digitalWrite(ledPin1,LOW);
digitalWrite(ledPin2,HIGH);
digitalWrite(ledPin3,HIGH);
}
//111
else((BottomSensor<=6500) && (CentreSensor<=3700) && (TopSensor>=3700 &&  
TopSensor<=6900)){
digitalWrite(ledPin1,HIGH);
digitalWrite(ledPin2,HIGH);
digitalWrite(ledPin3,HIGH);
}
}

Read the how to use this forum sticky, then modify that post so the code uses code tags, the </> icon. And you remove the spaces between each line.

The first case of LEDs /000 is not needed as all the LEDs are turned off anyway by the code.
That way of lighting three Leds is very turged but it should work. How are the LEDs wired up? You do have resistors on them don’t you.
Will they work with a simple blink sketch?
Once the code is posted correctly I can get a proper look at it.

Done. The program works with a simple blink and the LEDs have resistors connected.We tested the pins and the output voltage wasn't crossing 1V The program works fine and LED glows if its only one sensor...when combined it doesn't work.

(TopSensor < 3700 &&  TopSensor > 6900)

When is that ever going to be true?

When the height of the object lies between 3.5-4.1 feet

nitin1995: When the height of the object lies between 3.5-4.1 feet

Honestly? What distance is less than 3.5 feet and more than 4.1 feet? Read the code I quoted very carefully, again.

its 3.5-6.1…im sorry it was a typo.This is for an object suspended from the ceiling with the heights measured from the ground for the objects which arent detected by the centre sensor

Go back to reply #3. Stare at it until you understand.

That && means AND, is it || for OR that you want to use?