Problem with an obstacle detector

I started a project for school on an obstacle detector for blind people but it does not work and I do not understand why, can you help me?

There is my program:

int trig=13;
int echo=12;
int trig2=11;
int echo2=10;
int trig3=9;
int echo3=8;
int led=7;
int led2=6;
long lecture_echo;
long cm;
long lecture_echo2;
long cm2;
long lecture_echo3;
long cm3;

void setup() {
pinMode(trig, OUTPUT);
digitalWrite(trig, LOW);
pinMode(echo, INPUT);
pinMode(trig2, OUTPUT);
digitalWrite(trig2, LOW);
pinMode(echo2, INPUT);
pinMode(trig3, OUTPUT);
digitalWrite(trig3, LOW);
pinMode(echo3, INPUT);
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
Serial.begin(9600);

}

void loop() {
distance();
distance2();
distance3();
}

void distance(){
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, LOW);
lecture_echo = pulseIn(echo, HIGH);
cm = (lecture_echo340)/(210000);
Serial.print("Distancecm : ");
Serial.println(cm);
}

void distance2(){
digitalWrite(trig2, HIGH);
delayMicroseconds(10);
digitalWrite(trig2, LOW);
lecture_echo2 = pulseIn(echo2, HIGH);
cm2 = (lecture_echo2340)/(210000);
Serial.print("Distancecm2 : ");
Serial.println(cm);
}

void distance3(){
digitalWrite(trig3, HIGH);
delayMicroseconds(10);
digitalWrite(trig3, LOW);
lecture_echo3 = pulseIn(echo3, HIGH);
cm3 = (lecture_echo3340)/(210000);
Serial.print("Distancecm3 : ");
Serial.println(cm);
}
void fctif(){
if ((cm<10) && (cm2<10)){
digitalWrite(led, HIGH);
digitalWrite(led2, LOW);
}
else if ((cm2<10) && (cm3<10)){
digitalWrite(led, LOW);
digitalWrite(led2, HIGH);
}
else if ((cm<10) && (cm3<10)){
digitalWrite(led, HIGH);
digitalWrite(led2, HIGH);
}
else {
digitalWrite(led, LOW);
digitalWrite(led2,HIGH);
}
}

I’m using 3 captors HC-SR04, 2 leds and an Arduino UNO.

it does not work

What should it do ? What does it do ?

Please put your code in code tags as described in read this before posting a programming question

I see that you are not calling the fctif() function. Did you mean to ?

I see that i wasnt calling the function fctif so I change it, but it doesnt work... The program need to detect an obstacle at 10 cm, and if 2 detectors detect the same the program will tell to the utilisator that there is an obstacle.

but it doesnt work

What does it do? Lounge around all day, drinking beer and playing PS4?

You have debug prints. What do they tell you?

You have three copies of the function "distance". Why?

Where are the code tags?

but it doesnt work..

Please refer to reply #1

int trig=13;
int echo=12;
int trig2=11;
int echo2=10;
int trig3=9;
int echo3=8;

When you start numbering variables, it's time to use arrays.

void distance(){
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);
  lecture_echo = pulseIn(echo, HIGH);
  cm = (lecture_echo*340)/(2*10000);
  Serial.print("Distancecm : ");
  Serial.println(cm);
  }

void distance2(){
  digitalWrite(trig2, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig2, LOW);
  lecture_echo2 = pulseIn(echo2, HIGH);
  cm2 = (lecture_echo2*340)/(2*10000);
  Serial.print("Distancecm2 : ");
  Serial.println(cm);
  }

When you start numbering functions, it's time to get you head out of xxxxxxx and learn to pass arguments to functions and get results from functions.

Look at the logic in the stupidly named fctif function. It appears to me that there are 4 conditions - distances 1 and 2 are less than 10, distances 1 and 3 are less than 10; distances 2 and 3 are less than 10, and not more than one distance is less than 10.

There should, therefore be 4 different combinations of LED states - none lit, one lit, the other one lit, and both lit.

You do not have 4 combinations of LED states. You only have 3.