/* * This method makes the robot drive FRONT or BACK depending on the direction it is given. */ public void drive(Direction direction) { if (direction == Direction.FRONT) { Motor.A.forward(); Motor.B.forward(); } else if (direction == Direction.BACK) { Motor.A.backward(); Motor.B.backward(); } }
/* * This method makes the robot turn 90 deg to the given direction */ public void turnNXT(Direction direction) { if (direction == Direction.RIGHT) { Motor.A.rotate(237); } else if (direction == Direction.LEFT) { Motor.B.rotate(237); } }
public static void main(String[] args) { Motor.B.rotate(1440, false); }
/* * This method makes the robot stop. */ public void stop() { Motor.A.stop(); Motor.B.stop(); }