diff --git a/src/main/cpp/RobotContainer.cpp b/src/main/cpp/RobotContainer.cpp index 7e08dac..e573718 100644 --- a/src/main/cpp/RobotContainer.cpp +++ b/src/main/cpp/RobotContainer.cpp @@ -56,6 +56,10 @@ void RobotContainer::ConfigureButtonBindings() { new frc2::RunCommand([this] {m_shooter.Stop();}, {&m_shooter}) ); + // Start button sets DIO 0 high when pressed, low when released + frc2::JoystickButton(&m_driverController, frc::XboxController::Button::kStart) + .OnTrue(new frc2::InstantCommand([this] { m_dio0.Set(true); })) + .OnFalse(new frc2::InstantCommand([this] { m_dio0.Set(false); })); } frc2::Command* RobotContainer::GetAutonomousCommand() { diff --git a/src/main/include/RobotContainer.h b/src/main/include/RobotContainer.h index 876a6b8..8ed0e00 100644 --- a/src/main/include/RobotContainer.h +++ b/src/main/include/RobotContainer.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include @@ -39,6 +40,9 @@ class RobotContainer { // The robot's subsystems and commands are defined here... + // Digital outputs + frc::DigitalOutput m_dio0{0}; + // The robot's subsystems DriveSubsystem m_drive; CameraSubsystem m_camera;