コード例 #1
0
 /*
  * 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();
   }
 }
コード例 #2
0
  /*
   * 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);
    }
  }
コード例 #3
0
ファイル: GetARound.java プロジェクト: barcaxi/psol
 public static void main(String[] args) {
   Motor.B.rotate(1440, false);
 }
コード例 #4
0
 /*
  * This method makes the robot stop.
  */
 public void stop() {
   Motor.A.stop();
   Motor.B.stop();
 }