## Exercise 1: LEGO vehicle that exhibits a single behavior
#### Task: The program AvoidFigure9_3.java implements the avoid behavior with a single ultrasonic sensor. Download the program and observe the car. Describe how the car behaves.
#### Task:
The program AvoidFigure9_3.java implements the avoid behavior with a single ultrasonic sensor. Download the program and observe the car. Describe how the car behaves.
#### Plan: The program was executed without changes in the code.
#### Plan:
The program was executed without changes in the code.
#### Result:
...
...
@@ -59,4 +66,10 @@ As seen in the video the car drives and turns in order to avoid surface contact.
}
}
```
#### Task 2:
Change the program so that the car drives backwards a little when all the three distances,leftDistance, frontDistance, and rightDistance are less than stopThreshold, and afterwards the car should spin around on the spot 180 degrees.
#### Plan
We wish to implement a behavior that handles a situation where the robot is close to a surface in the directions front, left and right and makes a u-turn and drives in the opposite direction.