this is the code that i have done, can any one tell whats wrong with it?
- Code: Select all
public void jStart() {
float fMaxSpeed = pilot.getMoveMaxSpeed();
pilot.setMoveSpeed(fMaxSpeed);
pilot.backward();
while(!pilot.isMoving())
{
int distance = UltrasonicSensor.getDistance();
if (distance > 20)
{
pilot.backward();
pilot.stop();
pilot.rotate(-180);
pilot.stop();
pilot.backward();
}
}
}
