TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MaxSpeedTest.java
// ColorSensor colorSensor;    // Hardware Device Object
ColorSensor colorSensor;    // Hardware Device Object
ColorSensor colorSensor ; // Hardware Device Object
@Override
    public void runOpMode() throws InterruptedException {
        myRobot.init(hardwareMap);
        myRobot.rightFrontMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
        myRobot.rightRearMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
        myRobot.leftFrontMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
        myRobot.leftRearMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
        waitForStart();
        while (opModeIsActive()) {
            double time = this.getRuntime();
            while (this.getRuntime() - time < 5 && opModeIsActive()) {
                myRobot.rightFrontMotor.setPower(1);
                myRobot.rightRearMotor.setPower(1);
                myRobot.leftFrontMotor.setPower(1);
                myRobot.leftRearMotor.setPower(1);
            }
            myRobot.rightFrontMotor.setPower(0);
            myRobot.rightRearMotor.setPower(0);
            myRobot.leftFrontMotor.setPower(0);
            myRobot.leftRearMotor.setPower(0);
            while (opModeIsActive()) {
                telemetry.addData("Right front max speed", myRobot.rightFrontMotor.getCurrentPosition() / 5);
                telemetry.addData("Right rear max speed", myRobot.rightRearMotor.getCurrentPosition() / 5);
                telemetry.addData("Left front max speed", myRobot.leftFrontMotor.getCurrentPosition() / 5);
                telemetry.addData("Left rear max speed", myRobot.leftRearMotor.getCurrentPosition() / 5);
                telemetry.update();
            }
            requestOpModeStop();
        }
    }
@ Override public void runOpMode ( ) throws InterruptedException { myRobot . init ( hardwareMap ) ; myRobot . rightFrontMotor . setMode ( DcMotor . RunMode . RUN_WITHOUT_ENCODER ) ; myRobot . rightRearMotor . setMode ( DcMotor . RunMode . RUN_WITHOUT_ENCODER ) ; myRobot . leftFrontMotor . setMode ( DcMotor . RunMode . RUN_WITHOUT_ENCODER ) ; myRobot . leftRearMotor . setMode ( DcMotor . RunMode . RUN_WITHOUT_ENCODER ) ; waitForStart ( ) ; while ( opModeIsActive ( ) ) { double time = this . getRuntime ( ) ; while ( this . getRuntime ( ) - time < 5 && opModeIsActive ( ) ) { myRobot . rightFrontMotor . setPower ( 1 ) ; myRobot . rightRearMotor . setPower ( 1 ) ; myRobot . leftFrontMotor . setPower ( 1 ) ; myRobot . leftRearMotor . setPower ( 1 ) ; } myRobot . rightFrontMotor . setPower ( 0 ) ; myRobot . rightRearMotor . setPower ( 0 ) ; myRobot . leftFrontMotor . setPower ( 0 ) ; myRobot . leftRearMotor . setPower ( 0 ) ; while ( opModeIsActive ( ) ) { telemetry . addData ( "Right front max speed" , myRobot . rightFrontMotor . getCurrentPosition ( ) / 5 ) ; telemetry . addData ( "Right rear max speed" , myRobot . rightRearMotor . getCurrentPosition ( ) / 5 ) ; telemetry . addData ( "Left front max speed" , myRobot . leftFrontMotor . getCurrentPosition ( ) / 5 ) ; telemetry . addData ( "Left rear max speed" , myRobot . leftRearMotor . getCurrentPosition ( ) / 5 ) ; telemetry . update ( ) ; } requestOpModeStop ( ) ; } }
ColorSensor colorSensor;    // Hardware Device Object
ColorSensor colorSensor ; // Hardware Device Object