Quasics2020Code/Gladys/src/main/cpp/RobotContainer.cpp
//
// Configuring buttons on the operator's controller.
//
Configuring buttons on the operator's controller.
Configuring buttons on the operator ' s controller .
void RobotContainer::ConfigureOperatorButtonBindings() {
  typedef frc::XboxController::Button Button;  
   Commands that we want to let the operator's controller trigger.
  static LoadFromWindowCommand loadFromWindow(&exhaust);
  static DeliverToLowGoalCommand deliverToGoal(&exhaust);
  static SpinTheWheelCommand spinTheWheel(&commandPanel, true);
  static ClimberUpCommand climberUp(&climber);
  static ClimberDownCommand climberDown(&climber);
  static IntakeBallsFromFloorCommand intakeFromFloor(&intake, &exhaust);
  static TurnControlPanel4TimesCommand turnPanel4Times(&commandPanel);
  static TurnControlPanelToTargetColorCommand turnPanelToColor(&commandPanel);
   Bind the commands to the buttons.
   Exhaust
  RunCommandWhenOperatorButtonIsHeld(Button::kY, &loadFromWindow);
  RunCommandWhenOperatorButtonIsHeld(Button::kB, &deliverToGoal);
   Intake
  RunCommandWhenOperatorButtonIsHeld(Button::kA, &intakeFromFloor);
  RunCommandWhenOperatorButtonIsHeld(Button::kBumperLeft, &climberUp);
  RunCommandWhenOperatorButtonIsHeld(Button::kBumperRight, &climberDown);
   Control panel
  RunCommandWhenOperatorButtonIsHeld(Button::kStart, &spinTheWheel);
#if 0
      ***
      *** These are currently disabled: the buttons are already in use....
      ***
  RunCommandWhenOperatorButtonIsPressed(Button::kBumperLeft, &turnPanel4Times);
  RunCommandWhenOperatorButtonIsPressed(Button::kBumperRight,
                                        &turnPanelToColor);
#endif
  std::cout << "Completed button binding configuration (Operator)" << std::endl;
}
void RobotContainer :: ConfigureOperatorButtonBindings ( ) { typedef frc :: XboxController :: Button Button ; static LoadFromWindowCommand loadFromWindow ( & exhaust ) ; static DeliverToLowGoalCommand deliverToGoal ( & exhaust ) ; static SpinTheWheelCommand spinTheWheel ( & commandPanel , true ) ; static ClimberUpCommand climberUp ( & climber ) ; static ClimberDownCommand climberDown ( & climber ) ; static IntakeBallsFromFloorCommand intakeFromFloor ( & intake , & exhaust ) ; static TurnControlPanel4TimesCommand turnPanel4Times ( & commandPanel ) ; static TurnControlPanelToTargetColorCommand turnPanelToColor ( & commandPanel ) ; RunCommandWhenOperatorButtonIsHeld ( Button :: kY , & loadFromWindow ) ; RunCommandWhenOperatorButtonIsHeld ( Button :: kB , & deliverToGoal ) ; RunCommandWhenOperatorButtonIsHeld ( Button :: kA , & intakeFromFloor ) ; RunCommandWhenOperatorButtonIsHeld ( Button :: kBumperLeft , & climberUp ) ; RunCommandWhenOperatorButtonIsHeld ( Button :: kBumperRight , & climberDown ) ; RunCommandWhenOperatorButtonIsHeld ( Button :: kStart , & spinTheWheel ) ; #if 0 RunCommandWhenOperatorButtonIsPressed ( Button :: kBumperLeft , & turnPanel4Times ) ; RunCommandWhenOperatorButtonIsPressed ( Button :: kBumperRight , & turnPanelToColor ) ; #endif std :: cout << " " << std :: endl ; }
Configuring buttons on the operator's controller.
Configuring buttons on the operator ' s controller .
// For convenient/shorter naming // // Commands that we want to let the operator's controller trigger. // // Bind the commands to the buttons. // Exhaust // Intake // Control panel //    *** //    *** These are currently disabled: the buttons are already in use.... //    ***