From e91401dabfbd8de0568fef8158105f4f8443d053 Mon Sep 17 00:00:00 2001 From: WILLIAM WANG Date: Fri, 22 Mar 2024 12:01:50 -0700 Subject: [PATCH] Enable on teleop-compressor --- src/main/java/frc/robot/Robot.java | 2 ++ src/main/java/frc/robot/RobotContainer.java | 4 ++++ src/main/java/frc/robot/subsystems/ClimberSubsystem.java | 2 -- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 3dadca9..6681434 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -96,6 +96,8 @@ public void teleopInit() { } m_robotContainer.resetAllSubsystems(); + + m_robotContainer.compressorInit(); } /** This function is called periodically during operator control. */ diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 7422d9a..005bb08 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -240,6 +240,10 @@ public void resetAllSubsystems() { m_robotDrive.reset(); } + public void compressorInit(){ + m_climberSubsystem.toggleCompressor(); + } + /** * Use this to pass the autonomous command to the main {@link Robot} class. * diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 8da249a..7a2f791 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -24,13 +24,11 @@ public class ClimberSubsystem extends SubsystemBase { private Value m_state; public ClimberSubsystem() { - m_compressorEnabled = false; m_pHub = new PneumaticHub(2); solenoidOff(); m_compressorEnabled = false; - toggleCompressor(); } // Runs once every tick (~20ms)