reading information from sd card

Well, you could put Serial.println("moving forward"); in the block that is supposed to move the car forward. If you see "moving forward" on the Serial Monitor, but the car is turning left, you know one thing. If you see "moving forward" and the car is moving forward, you know something else.

Ok I did as you said and this is what I got

distance: 30
distance: 45
distance: 15
Smallest value 15
position of smallest 2
turning right
distance: 30
distance: 45
distance: 15
Smallest value 15
position of smallest 2
turning right
distance: 32
distance: 35
distance: 45
Smallest value 32
position of smallest 0
moving forward
distance: 34
distance: 36
distance: 126
Smallest value 34
position of smallest 0
moving forward
distance: 12
distance: 45
distance: 65
Smallest value 12
position of smallest 0
turning left
distance: 15
distance: 36
distance: 126
Smallest value 15
position of smallest 0
turning left

so, the program is doing everything what is suppose to do but the hardware is not responding to it. It looks like the car get stuck at turning right and don't do anything anymore