TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DRSS_TeleOp1.java
//Declare all variables that will be used by the program.
Declare all variables that will be used by the program.
Declare all variables that will be used by the program .
@Override
    public void init() {
        /*The following series of try/catch statements attempt to assign each declared hardware
         *device to a physical hardware device on the robot
         */
        try {
            leftMotor = hardwareMap.dcMotor.get("leftMotor");
            leftMotor.setDirection(DcMotor.Direction.REVERSE);
        } catch (Exception eLeftMotor) {
            telemetry.addData("Exception ", "leftMotor not found");
            leftMotor = null;
        }
        try {
            DriveMotorController = hardwareMap.dcMotorController.get("DriveMotorController");
        } catch (Exception eDriveMotorController) {
            DriveMotorController = null;
            telemetry.addData("Exception ", "DriveMotorController not found");
        }
        try {
            ShooterMotorController = hardwareMap.dcMotorController.get("ShooterMotorController");
        } catch (Exception eShooterMotorController) {
            ShooterMotorController = null;
            telemetry.addData("Exception ", "ShooterMotorController not found");
        }
        try {
            colorSensor = hardwareMap.colorSensor.get("colorSensor");
        } catch (Exception eColorSensor) {
            colorSensor = null;
            telemetry.addData("Exception ", "colorSensor not found");
        }
        try {
            rightMotor = hardwareMap.dcMotor.get("rightMotor");
            rightMotor.setDirection(DcMotor.Direction.FORWARD);
        } catch (Exception eRightMotor) {
            telemetry.addData("Exception ", "rightMotor not found");
            rightMotor = null;
        }
        try {
            particleAccelerator = hardwareMap.dcMotor.get("particleAccelerator");
            particleAccelerator.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
        } catch (Exception eParticleAccelerator) {
            telemetry.addData("Exception ", "particleAccelerator not found");
            particleAccelerator = null;
        }
        try {
            backFlap = hardwareMap.servo.get("backFlap");
            backFlap.setDirection(Servo.Direction.FORWARD);
        } catch (Exception eBackFlap) {
            telemetry.addData("Exception ", "backFlap not found");
            backFlap = null;
        }
        try {
            pushRod = hardwareMap.crservo.get("pushRod");
        } catch (Exception ePushRod) {
            telemetry.addData("Exception ", "pushRod not found");
            pushRod = null;
        }
        try {
            servoController = hardwareMap.servoController.get("ServoController");
        }catch (Exception eServoController){
                telemetry.addData("Exception: ", "ServoController not found");
                servoController = null;
        }
        try {
            particleLift = hardwareMap.dcMotor.get("particleLift");
        } catch (Exception eParticleLift) {
            telemetry.addData("Exception ", "particleLift not found");
            particleLift = null;
        }
    }
@ Override public void init ( ) { /*The following series of try/catch statements attempt to assign each declared hardware
         *device to a physical hardware device on the robot
         */ try { leftMotor = hardwareMap . dcMotor . get ( "leftMotor" ) ; leftMotor . setDirection ( DcMotor . Direction . REVERSE ) ; } catch ( Exception eLeftMotor ) { telemetry . addData ( "Exception " , "leftMotor not found" ) ; leftMotor = null ; } try { DriveMotorController = hardwareMap . dcMotorController . get ( "DriveMotorController" ) ; } catch ( Exception eDriveMotorController ) { DriveMotorController = null ; telemetry . addData ( "Exception " , "DriveMotorController not found" ) ; } try { ShooterMotorController = hardwareMap . dcMotorController . get ( "ShooterMotorController" ) ; } catch ( Exception eShooterMotorController ) { ShooterMotorController = null ; telemetry . addData ( "Exception " , "ShooterMotorController not found" ) ; } try { colorSensor = hardwareMap . colorSensor . get ( "colorSensor" ) ; } catch ( Exception eColorSensor ) { colorSensor = null ; telemetry . addData ( "Exception " , "colorSensor not found" ) ; } try { rightMotor = hardwareMap . dcMotor . get ( "rightMotor" ) ; rightMotor . setDirection ( DcMotor . Direction . FORWARD ) ; } catch ( Exception eRightMotor ) { telemetry . addData ( "Exception " , "rightMotor not found" ) ; rightMotor = null ; } try { particleAccelerator = hardwareMap . dcMotor . get ( "particleAccelerator" ) ; particleAccelerator . setMode ( DcMotor . RunMode . RUN_USING_ENCODER ) ; } catch ( Exception eParticleAccelerator ) { telemetry . addData ( "Exception " , "particleAccelerator not found" ) ; particleAccelerator = null ; } try { backFlap = hardwareMap . servo . get ( "backFlap" ) ; backFlap . setDirection ( Servo . Direction . FORWARD ) ; } catch ( Exception eBackFlap ) { telemetry . addData ( "Exception " , "backFlap not found" ) ; backFlap = null ; } try { pushRod = hardwareMap . crservo . get ( "pushRod" ) ; } catch ( Exception ePushRod ) { telemetry . addData ( "Exception " , "pushRod not found" ) ; pushRod = null ; } try { servoController = hardwareMap . servoController . get ( "ServoController" ) ; } catch ( Exception eServoController ) { telemetry . addData ( "Exception: " , "ServoController not found" ) ; servoController = null ; } try { particleLift = hardwareMap . dcMotor . get ( "particleLift" ) ; } catch ( Exception eParticleLift ) { telemetry . addData ( "Exception " , "particleLift not found" ) ; particleLift = null ; } }
Declare all variables that will be used by the program.
Declare all variables that will be used by the program .