import lejos.nxt.*;
import lejos.navigation.*;
public class TachoNav1
{
static TachoNavigator tachoNav;
public static void main( String[] args)
{
tachoNav = new TachoNavigator(2.25f, 4.4f, Motor.A, Motor.C);
tachoNav.setSpeed(500);
tachoNav.setPosition(0, 0, 90);
tachoNav.goTo(-10, 0);
int row = 0;
print(row);
Button.waitForPress();
tachoNav.goTo(10,20, true);
while (tachoNav.isMoving())
{
Sound.pause(500);
tachoNav.updatePosition();
print(row++);
if (row > 7)row = 1;
}
tachoNav.stop();
print(row);
Button.waitForPress();
}
static void print(int row)
{
LCD.drawInt((int)tachoNav.getX(),4,0,row);
LCD.drawInt((int)tachoNav.getY(), 4,6, row);
LCD.drawInt((int)tachoNav.getAngle(),4,10,row);
}
}