The car behaves as expected. It starts driving according to the light readings, where it drives in the direction with the most light. However if an object comes close, the ultrasonic sensor takes control and the robot turns toward the area with the most space. If the object is not detected by the ultrasonic sensor the robot will detect the object through the touch sensors on the bumper and make the reverse and turn away from the encountered object. This behavior is seen in Fig.10:
The car behaves as expected. It starts driving according to the light readings, where it drives in the direction with the most light. However if an object comes close, the ultrasonic sensor takes control and the robot turns toward the area with the most space. If the object is not detected by the ultrasonic sensor the robot will detect the object through the touch sensors on the bumper and make the reverse and turn away from the encountered object. This behavior is seen in Fig.10:
[](https://drive.google.com/file/d/0B7MCCWb4fFztNkVudXZIaWgwQjQ/view?usp=sharing)
## Exercise 4: Add a third motor to turn the light sensor
## Exercise 4: Add a third motor to turn the light sensor
For this exercise we mounted the light sensor so it can be turned by a horizontal motor (Fig.11)
For this exercise we mounted the light sensor so it can be turned by a horizontal motor (Fig.11)