I haven't run the following but I hope it gives you an idea of how you can simplify your sketch and control the delay between each ping
int ultraSoundSignalPins[] = {8,7,6,9}; // Front Left,Front, Front Right, Rear Ultrasound signal pins
char *pingString[] = {"Front Left ","Front ", "Front Right ", "Rear "}; // just something to print to indicate direction
void setup()
{
Serial.begin(9600);
}
//Ping function
unsigned long ping(int index)
{
unsigned long echo;
pinMode(index, OUTPUT); // Switch signalpin to output
digitalWrite(index, LOW); // Send low pulse
delayMicroseconds(2); // Wait for 2 microseconds
digitalWrite(index, HIGH); // Send high pulse
delayMicroseconds(5); // Wait for 5 microseconds
digitalWrite(index, LOW); // Holdoff
pinMode(index, INPUT); // Switch signalpin to input
digitalWrite(index, HIGH); // Turn on pullup resistor
echo = pulseIn(index, HIGH); //Listen for echo
return (echo / 58.138) * .39; //convert to CM then to inches
}
void loop()
{
unsigned long ultrasoundValue;
for(int i=0; i < 4; i++){
ultrasoundValue = ping(i);
Serial.print(pingString[i]);
Serial.print(ultrasoundValue);
Serial.print("in, ");
delay(50);
}
Serial.println();
delay(50);
}