src/main/java/frc/robot/RobotContainer.java
/**
	 * Use this method to define your button->command mappings. Buttons can be
	 * created by instantiating a {@link GenericHID} or one of its subclasses
	 * ({@link edu.wpi.first.wpilibj.Joystick} or {@link XboxController}), and then
	 * passing it to a {@link command.button.JoystickButton}.
	 */
Use this method to define your button->command mappings. Buttons can be
created by instantiating a  GenericHID or one of its subclasses
( edu.wpi.first.wpilibj.Joystick or  XboxController), and then
passing it to a  command.button.JoystickButton.
Use this method to define your button - > command mappings . Buttons can be created by instantiating a GenericHID or one of its subclasses ( edu . wpi . first . wpilibj . Joystick or XboxController ) and then passing it to a command . button . JoystickButton .
private void configureButtonBindings() {
		m_oi.getButton(1, Buttons.LEFT_BUMPER).whileHeld(vc);
		m_oi.getButton(1, Buttons.B_BUTTON).whileHeld(new ExecuteEndCommand(()->m_shroud.shroudReset(0.5),()->m_shroud.shroudReset(0),m_shroud));
		m_oi.getButton(1, Buttons.B_BUTTON).whileHeld(new InstantCommand(()->m_turret.resetTurret(), m_turret));
		m_oi.getButton(1, Buttons.RIGHT_BUMPER).whileHeld(new SpoolShooterCmd(m_shooter, m_kicker, Constants.TEMPSPEED ));
		m_oi.getButton(1, Buttons.RIGHT_BUMPER).whileHeld(new PushBallsCmd(m_hopper, m_intake, m_shooter));
		m_oi.getButton(1, Buttons.X_BUTTON).whileHeld(new ExecuteEndCommand(()->m_intake.setIntake(0.4), ()->m_intake.setIntake(0), m_intake));
		m_oi.getButton(1, Buttons.X_BUTTON).whileHeld(new ExecuteEndCommand(()->m_hopper.setHopper(0.7), ()->m_hopper.setHopper(0), m_hopper));
		m_oi.getPovButton(1, 270).whileHeld(new ExecuteEndCommand(()->m_shroud.shroudReset(-0.7),()->m_shroud.shroudReset(0), m_shroud));
		m_oi.getPovButton(1, 90).whileHeld(new ExecuteEndCommand(()->m_shroud.shroudReset(0.7),()->m_shroud.shroudReset(0), m_shroud));
		/*SmartDashboard.putString("DB/String 1", "RightPOV: " + m_oi.getPovButton(1, 90).get());
		SmartDashboard.putString("DB/String 2", "LeftPOV: " + m_oi.getPovButton(1, 270).get());
		SmartDashboard.putString("DB/String 3", "UpPOV:" + m_oi.getPovButton(1, 0).get());
		SmartDashboard.putString("DB/String 4", "DownPOV:" + m_oi.getPovButton(1, 180).get());*/
		m_oi.getPovButton(1, 0)
				.whileHeld(new ExecuteEndCommand(() -> m_intake.setPivot(0.7), () -> m_intake.setPivot(0), m_intake));
		m_oi.getPovButton(1, 180)
				.whileHeld(new ExecuteEndCommand(() -> m_intake.setPivot(-0.5), () -> m_intake.setPivot(0), m_intake));
		m_oi.getButton(1, Buttons.Y_BUTTON)
				.whileHeld(new InstantCommand(() -> m_climber.setPistons(DoubleSolenoid.Value.kForward), m_climber));
		m_oi.getButton(1, Buttons.A_BUTTON)
				.whileHeld(new InstantCommand(() -> m_climber.setPistons(DoubleSolenoid.Value.kReverse), m_climber));
		.whileHeld(new InstantCommand(() -> m_hopper.setHopper(-0.5), m_hopper));
		.whileHeld(new InstantCommand(() -> m_intake.setIntake(-0.5), m_intake));
	}
private void configureButtonBindings ( ) { m_oi . getButton ( 1 , Buttons . LEFT_BUMPER ) . whileHeld ( vc ) ; m_oi . getButton ( 1 , Buttons . B_BUTTON ) . whileHeld ( new ExecuteEndCommand ( ( ) -> m_shroud . shroudReset ( 0.5 ) , ( ) -> m_shroud . shroudReset ( 0 ) , m_shroud ) ) ; m_oi . getButton ( 1 , Buttons . B_BUTTON ) . whileHeld ( new InstantCommand ( ( ) -> m_turret . resetTurret ( ) , m_turret ) ) ; m_oi . getButton ( 1 , Buttons . RIGHT_BUMPER ) . whileHeld ( new SpoolShooterCmd ( m_shooter , m_kicker , Constants . TEMPSPEED ) ) ; m_oi . getButton ( 1 , Buttons . RIGHT_BUMPER ) . whileHeld ( new PushBallsCmd ( m_hopper , m_intake , m_shooter ) ) ; m_oi . getButton ( 1 , Buttons . X_BUTTON ) . whileHeld ( new ExecuteEndCommand ( ( ) -> m_intake . setIntake ( 0.4 ) , ( ) -> m_intake . setIntake ( 0 ) , m_intake ) ) ; m_oi . getButton ( 1 , Buttons . X_BUTTON ) . whileHeld ( new ExecuteEndCommand ( ( ) -> m_hopper . setHopper ( 0.7 ) , ( ) -> m_hopper . setHopper ( 0 ) , m_hopper ) ) ; m_oi . getPovButton ( 1 , 270 ) . whileHeld ( new ExecuteEndCommand ( ( ) -> m_shroud . shroudReset ( - 0.7 ) , ( ) -> m_shroud . shroudReset ( 0 ) , m_shroud ) ) ; m_oi . getPovButton ( 1 , 90 ) . whileHeld ( new ExecuteEndCommand ( ( ) -> m_shroud . shroudReset ( 0.7 ) , ( ) -> m_shroud . shroudReset ( 0 ) , m_shroud ) ) ; /*SmartDashboard.putString("DB/String 1", "RightPOV: " + m_oi.getPovButton(1, 90).get());
		SmartDashboard.putString("DB/String 2", "LeftPOV: " + m_oi.getPovButton(1, 270).get());
		SmartDashboard.putString("DB/String 3", "UpPOV:" + m_oi.getPovButton(1, 0).get());
		SmartDashboard.putString("DB/String 4", "DownPOV:" + m_oi.getPovButton(1, 180).get());*/ m_oi . getPovButton ( 1 , 0 ) . whileHeld ( new ExecuteEndCommand ( ( ) -> m_intake . setPivot ( 0.7 ) , ( ) -> m_intake . setPivot ( 0 ) , m_intake ) ) ; m_oi . getPovButton ( 1 , 180 ) . whileHeld ( new ExecuteEndCommand ( ( ) -> m_intake . setPivot ( - 0.5 ) , ( ) -> m_intake . setPivot ( 0 ) , m_intake ) ) ; m_oi . getButton ( 1 , Buttons . Y_BUTTON ) . whileHeld ( new InstantCommand ( ( ) -> m_climber . setPistons ( DoubleSolenoid . Value . kForward ) , m_climber ) ) ; m_oi . getButton ( 1 , Buttons . A_BUTTON ) . whileHeld ( new InstantCommand ( ( ) -> m_climber . setPistons ( DoubleSolenoid . Value . kReverse ) , m_climber ) ) ; }
Use this method to define your button->command mappings.
Use this method to define your button - > command mappings .
//auto aim //resetShroud pos //m_oi.getButton(1, Buttons.LEFT_BUMPER).whenReleased(new InstantCommand(()->m_shroud.setShroud(0)), true	); // Auto Shoot balls // Toggle Shroud Presets //m_oi.getPovButton(1, 270).whenPressed(new InstantCommand(() -> m_shroud.setDesiredPosition(goUp()), m_shroud)); //m_oi.getPovButton(1, 90).whenPressed(new InstantCommand(() -> m_shroud.setDesiredPosition(goDown()), m_shroud)); // Bring intake up //m_oi.getButton(1, Buttons.RIGHT_BUMPER).whileHeld(new InstantCommand(()->m_kicker.setKicker(0.5), m_kicker)); //m_oi.getButton(1, Buttons.RIGHT_BUMPER).whileHeld((m_shooter.isAtSpeed())?new InstantCommand(() -> m_hopper.setHopper(0.5), m_hopper):new InstantCommand(() -> m_hopper.setHopper(0), m_hopper)); //m_oi.getButton(1, Buttons.RIGHT_BUMPER).whileHeld((m_shooter.isAtSpeed())?new InstantCommand(() -> m_intake.setIntake(0.5), m_intake):new InstantCommand(() -> m_intake.setIntake(0), m_intake));	 // Bring intake down // Extend the climber pistons // Move kicker wheel back to clear ball and then spool the shooter - X_Button changed to B_Button //m_oi.getButton(1, Buttons.B_BUTTON).whileHeld(new SpoolShooterCmd(m_shooter, m_kicker, 10000.0)); // This command shall not be used anymore. It creates problems with the battery, kicker gearbox and motor. //m_oi.getButton(1, Buttons.B_BUTTON) //		.whileHeld(new ExecuteEndCommand(() -> m_kicker.setKicker(-0.5), () -> m_kicker.setKicker(0), m_kicker) //				.withTimeout(0.1).andThen(new SpoolShooterCmd(m_shooter, m_kicker, 4300))); //m_oi.getButton(1, Buttons.B_BUTTON).whileHeld(new InstantCommand(() -> m_hopper.setHopper(-0.5), m_hopper)); //m_oi.getButton(1, Buttons.B_BUTTON).whileHeld(new InstantCommand(() -> m_intake.setIntake(-0.5), m_intake)); // Use the kicker to push the balls in