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 edu.wpi.first.wpilibj2.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  edu.wpi.first.wpilibj2.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 edu . wpi . first . wpilibj2 . command . button . JoystickButton .
private void configureButtonBindings() {
		new Button(m_controller::getBackButton)
				.whenPressed(new InstantCommand(m_drivetrainSubsystem::zeroGyroscope));
		new Button(m_controller::getBButton).whileHeld(new Fire(m_shooter, m_conveyor))
				.whenReleased(new InstantCommand(m_shooter::stopFiring));
		new Button(m_controller::getYButton).whileHeld(new InstantCommand(m_conveyor::start));
		new Button(m_controller::getRightBumper).whileHeld(new InstantCommand(m_intake::dropIntake))
				.whenReleased(new InstantCommand(m_intake::raiseIntake));
		new Button(m_controller::getXButton).whileHeld(new FenderShot(m_shooter, m_turret));
		new Button(m_controller::getLeftTriggerButton)
				.whileHeld(new TeleopTurnToTargetCommand(m_drivetrainSubsystem, m_shooterVision, m_shooter,
						m_turret, m_conveyor::isAllianceBallNext, m_controller::getLeftY, m_controller::getLeftY,
						m_controller::getRightTriggerAxis));
		new Button(m_controller::getLeftBumper).whenPressed(new Fire(m_shooter, m_conveyor))
				.whenReleased(m_shooter::stopFiring);
		new Button(m_controller::getDPadUp).whenPressed(new InstantCommand(() -> m_turret.up(10)));
		new Button(m_controller::getDPadDown).whenPressed(new InstantCommand(() -> m_turret.down(10)));
		new Button(m_controller::getDPadRight).whenPressed(new InstantCommand(() -> m_shooter.changeSpeed(100)));
		new Button(m_controller::getDPadLeft).whenPressed(new InstantCommand(() -> m_shooter.changeSpeed(-100)));
		new Button(m_operator_controller::getLeftBumper)
				.whenPressed(new InstantCommand(() -> m_conveyor.reverse(), m_conveyor));
		new Button(m_operator_controller::getRightBumper)
				.whenPressed(new InstantCommand(() -> m_conveyor.start(), m_conveyor));
		/*	new Button(m_programmer_controller::getBButton).whileHeld(new InstantCommand(m_shooter::fire))
				.whenReleased(new InstantCommand(m_shooter::stopFiring));
		new Button(m_programmer_controller::getYButton).whileHeld(new InstantCommand(m_conveyor::start));
		new Button(m_programmer_controller::getXButton).whileHeld(new InstantCommand(m_intake::start));// .whenReleased(new
																									// InstantCommand(m_intake::stop));
		new Button(m_programmer_controller::getDPadRight)
				.whenPressed(new InstantCommand(() -> m_shooter.changeSpeed(100)));
		new Button(m_programmer_controller::getDPadLeft)
				.whenPressed(new InstantCommand(() -> m_shooter.changeSpeed(-100)));
		new Button(m_programmer_controller::getLeftBumper).whileHeld(new InstantCommand(m_intake::dropIntake))
				.whenReleased(new InstantCommand(m_intake::raiseIntake));*/
	}
private void configureButtonBindings ( ) { new Button ( m_controller :: getBackButton ) . whenPressed ( new InstantCommand ( m_drivetrainSubsystem :: zeroGyroscope ) ) ; new Button ( m_controller :: getBButton ) . whileHeld ( new Fire ( m_shooter , m_conveyor ) ) . whenReleased ( new InstantCommand ( m_shooter :: stopFiring ) ) ; new Button ( m_controller :: getYButton ) . whileHeld ( new InstantCommand ( m_conveyor :: start ) ) ; new Button ( m_controller :: getRightBumper ) . whileHeld ( new InstantCommand ( m_intake :: dropIntake ) ) . whenReleased ( new InstantCommand ( m_intake :: raiseIntake ) ) ; new Button ( m_controller :: getXButton ) . whileHeld ( new FenderShot ( m_shooter , m_turret ) ) ; new Button ( m_controller :: getLeftTriggerButton ) . whileHeld ( new TeleopTurnToTargetCommand ( m_drivetrainSubsystem , m_shooterVision , m_shooter , m_turret , m_conveyor :: isAllianceBallNext , m_controller :: getLeftY , m_controller :: getLeftY , m_controller :: getRightTriggerAxis ) ) ; new Button ( m_controller :: getLeftBumper ) . whenPressed ( new Fire ( m_shooter , m_conveyor ) ) . whenReleased ( m_shooter :: stopFiring ) ; new Button ( m_controller :: getDPadUp ) . whenPressed ( new InstantCommand ( ( ) -> m_turret . up ( 10 ) ) ) ; new Button ( m_controller :: getDPadDown ) . whenPressed ( new InstantCommand ( ( ) -> m_turret . down ( 10 ) ) ) ; new Button ( m_controller :: getDPadRight ) . whenPressed ( new InstantCommand ( ( ) -> m_shooter . changeSpeed ( 100 ) ) ) ; new Button ( m_controller :: getDPadLeft ) . whenPressed ( new InstantCommand ( ( ) -> m_shooter . changeSpeed ( - 100 ) ) ) ; new Button ( m_operator_controller :: getLeftBumper ) . whenPressed ( new InstantCommand ( ( ) -> m_conveyor . reverse ( ) , m_conveyor ) ) ; new Button ( m_operator_controller :: getRightBumper ) . whenPressed ( new InstantCommand ( ( ) -> m_conveyor . start ( ) , m_conveyor ) ) ; /*	new Button(m_programmer_controller::getBButton).whileHeld(new InstantCommand(m_shooter::fire))
				.whenReleased(new InstantCommand(m_shooter::stopFiring));
		new Button(m_programmer_controller::getYButton).whileHeld(new InstantCommand(m_conveyor::start));
		new Button(m_programmer_controller::getXButton).whileHeld(new InstantCommand(m_intake::start));// .whenReleased(new
																									// InstantCommand(m_intake::stop));
		new Button(m_programmer_controller::getDPadRight)
				.whenPressed(new InstantCommand(() -> m_shooter.changeSpeed(100)));
		new Button(m_programmer_controller::getDPadLeft)
				.whenPressed(new InstantCommand(() -> m_shooter.changeSpeed(-100)));
		new Button(m_programmer_controller::getLeftBumper).whileHeld(new InstantCommand(m_intake::dropIntake))
				.whenReleased(new InstantCommand(m_intake::raiseIntake));*/ }
Use this method to define your button->command mappings.
Use this method to define your button - > command mappings .
// Back button zeros the gyroscope // No requirements because we don't need to interrupt anything // Operator Control //new Button(m_operator_controller::getXButton).whenHeld(new AutoClimber(m_Climber, m_drivetrainSubsystem.getPitchR2d()::getDegrees)); //new Button(m_operator_controller::getBButton).whenPressed(new PreClimbCommand(this)); // programmer controls