Changes
Page history
nhaulrik created page: Lab7
authored
Apr 17, 2015
by
Nikolaj Cilleborg Haulrik
Hide whitespace changes
Inline
Side-by-side
Lab7.markdown
View page @
835002d2
...
@@ -82,11 +82,9 @@ We wish to implement a behavior that handles a situation where the robot is clos
...
@@ -82,11 +82,9 @@ We wish to implement a behavior that handles a situation where the robot is clos
```
```
if ( leftDistance < stopThreshold && rightDistance < stopThreshold && frontDistance < stopThreshold ){
if ( leftDistance < stopThreshold && rightDistance < stopThreshold && frontDistance < stopThreshold ){
// back up
car.backward(power, power);
car.backward(power, power);
Delay.msDelay(ms);
Delay.msDelay(ms);
// Turn 180 degrees
car.forward(power, 0);
car.forward(power, 0);
Delay.msDelay(2000);
Delay.msDelay(2000);
car.backward(0, power);
car.backward(0, power);
...
...
...
...