... | ... | @@ -44,7 +44,20 @@ if(leftDistance < stopThreshold && |
|
|
}
|
|
|
```
|
|
|
|
|
|
The full code is
|
|
|
The `rotate` function added to the `PrivateCar` class is defined as follows:
|
|
|
|
|
|
```java
|
|
|
public void rotate(boolean left, int power)
|
|
|
{
|
|
|
int leftControl = left ? backward : forward;
|
|
|
int rightControl = left ? forward : backward;
|
|
|
|
|
|
leftMotor.controlMotor(power,leftControl);
|
|
|
rightMotor.controlMotor(power,rightControl);
|
|
|
}
|
|
|
```
|
|
|
|
|
|
The full code is available at [Single behavior].
|
|
|
|
|
|
## Concurrent behaviors
|
|
|
|
... | ... | |