TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DriverOpMode.java
/**
     * Uses up  down keypad to switch to different modes between shooting, stop, reverse, and intake
     */
Uses up  down keypad to switch to different modes between shooting, stop, reverse, and intake
Uses up down keypad to switch to different modes between shooting stop reverse and intake
private void handleIntakeAndShoot() {
        if (!dpadUpPressed && gamepad1.dpad_up) {
            switch (currentMode) {
                case STOP:
                case SHOOTING:
                case REVERSE:
                    robotHardware.startIntake();
                    robotHardware.ringHolderDown();
                    robotHardware.setShooterPosition(true);
                    currentMode = ActionMode.INTAKE;
                    break;
                case INTAKE:
                    robotHardware.reverseIntake();
                    robotHardware.startShootMotor((gamepad1.right_bumper)?robotProfile.hardwareSpec.shootBarVelocity:robotProfile.hardwareSpec.shootVelocity);
                    robotHardware.ringHolderUp();
                    robotHardware.setShooterPosition(true);
                    currentMode = ActionMode.SHOOTING;
                    break;
            }
        }
        dpadUpPressed = gamepad1.dpad_up;
        if (!dpadDownPressed && gamepad1.dpad_down) {
            switch (currentMode) {
                case SHOOTING:
                case REVERSE:
                    robotHardware.stopIntake();
                    robotHardware.ringHolderDown();
                    robotHardware.setShooterPosition(true);
                    currentMode = ActionMode.STOP;
                    break;
                case INTAKE:
                case STOP:
                    robotHardware.reverseIntake();
                    robotHardware.ringHolderDown();
                    robotHardware.setShooterPosition(true);
                    currentMode = ActionMode.REVERSE;
                    break;
            }
        }
        dpadDownPressed = gamepad1.dpad_down;
        if (gamepad1.x && gamepad1.left_bumper) {  
            currentTask = autoAimShoot;
            currentTask.prepare();
            if (! currentTask.isDone()) {
                currentMode = ActionMode.SHOOTING;
            }
        }
        if (gamepad1.x && gamepad1.right_bumper) {  
            currentTask = autoAimShoot;
            currentTask.prepare();
            if (! currentTask.isDone()) {
                currentMode = ActionMode.SHOOTING;
            }
        }
        else if (gamepad1.x && currentMode==ActionMode.SHOOTING) {
            currentTask = shootRingTask;
            currentTask.prepare();
        }
    }
private void handleIntakeAndShoot ( ) { if ( ! dpadUpPressed && gamepad1 . dpad_up ) { switch ( currentMode ) { case STOP : case SHOOTING : case REVERSE : robotHardware . startIntake ( ) ; robotHardware . ringHolderDown ( ) ; robotHardware . setShooterPosition ( true ) ; currentMode = ActionMode . INTAKE ; break ; case INTAKE : robotHardware . reverseIntake ( ) ; robotHardware . startShootMotor ( ( gamepad1 . right_bumper ) ? robotProfile . hardwareSpec . shootBarVelocity : robotProfile . hardwareSpec . shootVelocity ) ; robotHardware . ringHolderUp ( ) ; robotHardware . setShooterPosition ( true ) ; currentMode = ActionMode . SHOOTING ; break ; } } dpadUpPressed = gamepad1 . dpad_up ; if ( ! dpadDownPressed && gamepad1 . dpad_down ) { switch ( currentMode ) { case SHOOTING : case REVERSE : robotHardware . stopIntake ( ) ; robotHardware . ringHolderDown ( ) ; robotHardware . setShooterPosition ( true ) ; currentMode = ActionMode . STOP ; break ; case INTAKE : case STOP : robotHardware . reverseIntake ( ) ; robotHardware . ringHolderDown ( ) ; robotHardware . setShooterPosition ( true ) ; currentMode = ActionMode . REVERSE ; break ; } } dpadDownPressed = gamepad1 . dpad_down ; if ( gamepad1 . x && gamepad1 . left_bumper ) { currentTask = autoAimShoot ; currentTask . prepare ( ) ; if ( ! currentTask . isDone ( ) ) { currentMode = ActionMode . SHOOTING ; } } if ( gamepad1 . x && gamepad1 . right_bumper ) { currentTask = autoAimShoot ; currentTask . prepare ( ) ; if ( ! currentTask . isDone ( ) ) { currentMode = ActionMode . SHOOTING ; } } else if ( gamepad1 . x && currentMode == ActionMode . SHOOTING ) { currentTask = shootRingTask ; currentTask . prepare ( ) ; } }
Uses up  down keypad to switch to different modes between shooting, stop, reverse, and intake
Uses up down keypad to switch to different modes between shooting stop reverse and intake
// Auto Drive & Shoot //currentTask = autoDriveShoot; // auto aim & shoot