Commit aef19d50 authored by Casper's avatar Casper
Browse files

bah

parent 565e5e71
...@@ -12,7 +12,7 @@ public class Escape extends Thread { ...@@ -12,7 +12,7 @@ public class Escape extends Thread {
private int power = 70, ms = 500; private int power = 70, ms = 500;
TouchSensor left = new TouchSensor(SensorPort.S1); TouchSensor left = new TouchSensor(SensorPort.S1);
TouchSensor right = new TouchSensor(SensorPort.S2); TouchSensor right = new TouchSensor(SensorPort.S4);
Random r = new Random(); Random r = new Random();
public Escape(SharedCar car) { public Escape(SharedCar car) {
...@@ -40,15 +40,17 @@ public class Escape extends Thread { ...@@ -40,15 +40,17 @@ public class Escape extends Thread {
else if(left.isPressed()) { else if(left.isPressed()) {
car.backward(power, power); car.backward(power, power);
Delay.msDelay(ms); Delay.msDelay(ms);
car.forward(0, power); car.forward(power, 0);
Delay.msDelay(ms); Delay.msDelay(ms);
} }
// Right bump // Right bump
else if(right.isPressed()) { else if(right.isPressed()) {
car.backward(power, power); car.backward(power, power);
Delay.msDelay(ms); Delay.msDelay(ms);
car.forward(power, 0); car.forward(0, power);
Delay.msDelay(ms); Delay.msDelay(ms);
} else {
car.noCommand();
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment