Robot with 3 sonar sensors not moving

Greetings, I am trying to create a two wheel robot vehicle that is navigating according to the readings
of 3 Ultrasonic sensors (HC-SR04 name of module). The problem is that even though I am getting readings from all sensors the actuators are not moving. I succeeded previsouly on making a similar
project with just 1 sensor which makes me wonder about what went wrong. Here is the code for the
robot with the 3 sensors:

[#include <AFMotor.h>

uint8_t trigPin[]={13,12,8}; //{front,right-motor2,left-motor1}
uint8_t echoPin[]={7,6,4};
uint8_t distance[3],sonar_num=3,max_distance=30;
float readSensor(uint8_t sensor);
void Turn_Counter_Clockwise(),Turn_Clockwise();
AF_DCMotor motor1(1,MOTOR12_64KHZ);
AF_DCMotor motor2(2, MOTOR12_8KHZ);

void setup() {

Serial.begin(9600);

for(uint8_t sensor=0;sensor<sonar_num;sensor++){
pinMode(trigPin[sensor],OUTPUT);
pinMode(echoPin[sensor],INPUT);
}

motor1.setSpeed(255); //setting motor speed
motor2.setSpeed(255);

}

void loop() {

for(uint8_t sensor=0;sensor<sonar_num;sensor++){
distance[sensor]=readSensor(sensor);
Serial.print("Sensor " + String(sensor+1) + " reading: " +
String(distance[sensor]) + " cm." + ("\n"));
}

if(distance[0]<max_distance && distance[0]>0){
//if (distance[1]>distance[2]){
//Turn_Clockwise();
//delay(100);
//}
//else{
Turn_Counter_Clockwise();
delay(100);
//}
}
else if(distance[0]>=max_distance){
Move_Forward();
}

}

float readSensor(uint8_t sensor){
digitalWrite(trigPin[sensor],LOW);
digitalWrite(trigPin[sensor],HIGH);
digitalWrite(trigPin[sensor],LOW);
float duration=pulseIn(echoPin[sensor],HIGH);
return (duration/2)/29.1; //cm
}

void Turn_Clockwise(){
motor1.setSpeed(255);
motor2.setSpeed(255);
motor1.run(FORWARD);
motor2.run(BACKWARD);
}

void Turn_Counter_Clockwise(){
motor1.setSpeed(255);
motor2.setSpeed(255);
motor1.run(BACKWARD);
motor2.run(FORWARD);
}

void Move_Forward(){
motor1.setSpeed(255);
motor2.setSpeed(255);
motor1.run(FORWARD);
motor2.run(FORWARD);
}]

And here is the code for the robot that works:

[/#include <AFMotor.h>
#define trigPin 13
#define echoPin 7
uint8_t distance,max_distance=30;
float readSensor();
void Move_Forward(),Turn_Clockwise();
AF_DCMotor motor1(1,MOTOR12_64KHZ);
AF_DCMotor motor2(2,MOTOR12_8KHZ);

void setup() {
pinMode(trigPin,OUTPUT);
pinMode(echoPin,INPUT);
motor1.setSpeed(255);
motor2.setSpeed(255);

}

void loop() {

distance=readSensor();
if (distance>=max_distance && distance>0){
Move_Forward();
}
else{
Turn_Clockwise();
}
}

float readSensor(){
digitalWrite(trigPin,LOW);
digitalWrite(trigPin,HIGH);
digitalWrite(trigPin,LOW);
float duration=pulseIn(echoPin,HIGH);
return (duration/2)/29.1; //cm
}

void Turn_Clockwise(){
motor1.setSpeed(255);
motor2.setSpeed(255);
motor1.run(FORWARD);
motor2.run(BACKWARD);
}

void Move_Forward(){
motor1.setSpeed(255);
motor2.setSpeed(255);
motor1.run(FORWARD);
motor2.run(FORWARD);
}
]
I am using L293D motor driving shield. I apologize in advance if this post is messy(first one).
Any insight on the situation will be much appreciated.Thank you in advance.

for(uint8_t sensor=0;sensor<sonar_num;sensor++){
  distance[sensor]=readSensor(sensor);
  Serial.print("Sensor " + String(sensor+1) + " reading: " +\
  String(distance[sensor]) + " cm." + ("\n"));
 }

How long between pings?
How do you discriminate a late return from a different ping,?

Please use code tags when posting code

Behemon1993:
.....The problem is that even though I am getting readings from all sensors the actuators are not moving....

So the readings are correctly taking you into the code to turn of go straight but the motors are not running?

Try making your delays much longer just to see what happens.
How do you know you don;t have a wiring fault?