Ultrasonic srf05 Arduino

hi guys …
i need some help to get code ultrasonic obstacle sensore for car rc !
plz help i have this code but still incorrect …

#include <Servo.h>
#define echoPin 8
#define trigPin 7
Servo leftservo;
Servo rightservo;
void setup()

{
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
leftservo.attach(9);
rightservo.attach(10);
}

void loop()
{
int distance,duration;
digitalWrite(trigPin, HIGH);
delay(200);
digitalWrite(trigPin, LOW);
duration=pulseIn(echoPin, HIGH);
distance=(duration/2)/29.1;
Serial.println(distance);
if(distance >7) // for going forward
{
leftservo.write(360); // left wheel forward
rightservo.write(-360); // right wheel forward
}
else // obstacle detected turn left
{
leftservo.write(-360); //left wheel backward
rightservo.write(-360); // right wheel forward
}
}

but still incorrect ...

In what way is it incorrect ? What happens when you run it ?

leftservo.write(360); // left wheel forward
rightservo.write(-360); // right wheel forward
}
else // obstacle detected turn left
{
leftservo.write(-360); //left wheel backward
rightservo.write(-360); // right wheel forward

The write() method takes values from 0 to 180 so this section of code is wrong.

car dont stop when she has obstacle :(

sorry for my bad english

What value do you get when you print distance ?

Did you note what I said about the servo.write() values ?