Do you think my program will work?

UKHeliBob:

pro3000:
So to turn left I should write myservo.write(179);  ?

And to turn right I should write myservo.write(-179);  

Should put a delay after those commands and set myservo.write(0); to go straight than?

And the motor is a 6V motor from a car my teacher bought in a supermarket... It's a RC car. It has two wires.

To turn the servo (and I assume the steering) one way

 myservo.write(170);

and the other way

 myservo.write(0);

and straight between the two

 myservo.write(90);

What is there between the Arduino and the car ?

Thank you! And as I said before, I'm using a 7V battery with a tension regulator of 6V. Also I use a transistor.

So,there's the Arduino, after, I use a resistor. After, It's the transistor, the motor, the tension regulator and the battery.

My teacher made this circuit for us. I tested the circuit with the motor only and some digitalWrite in the Arduino and it worked perfectly.

Also, I've been told that the function return would stop my program so my second sensor wouldn't work. It's true? should I remove it?