Beispiel #1
0
  public static void main(String[] args) throws InterruptedException {
    OpticalDistanceSensor us = new OpticalDistanceSensor(SensorPort.S1);
    final DifferentialPilot pilot =
        new DifferentialPilot(
            RobotConstants.WHEEL_DIAMETER / 10,
            RobotConstants.TRACK_WIDTH / 10,
            RobotConstants.leftMotor,
            RobotConstants.rightMotor,
            true);
    final ColorSensor s = new ColorSensor(SensorPort.S3);

    RConsole.openBluetooth(60000);
    System.setOut(new PrintStream(RConsole.openOutputStream()));
    //   pilot.forward();
    while (!Button.ENTER.isPressed()) {
      System.out.println(s.getColorNumber());
      Thread.sleep(300);
    }
    RConsole.close();
  }