Hello
I found this code on http://lejos.sourceforge.net/nxt/nxj/tu ... hicles.htm on this address but there is some problem when I compile it, it gives an error that lejos.navigation does not exits. Any one has any idea, any kind of help will be appreciated.
CODE:
import lejos.nxt.*;
import lejos.navigation.Pilot;
/**
* Robot that stops if it hits something before it completes its travel.
*/
public class TravelTest {
Pilot pilot;
TouchSensor bump = new TouchSensor(SensorPort.S1);
public void go() {
pilot.travel(20, true);
while (pilot.isMoving()) {
if (bump.isPressed()) pilot.stop();
}
System.out.println(" "+pilot.getTravelDistance());
Button.ewaitForPress();
}
public static void main(String[] args) {
TravelTest traveler = new TravelTest();
traveler.pilot = new Pilot(2.25f, 5.5f, Motor.A, Motor,C);
traveler.go();
}
}
Thanks
Faheim
