Skip to content

Commit

Permalink
Update Pneumatics.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Advay17 committed Dec 1, 2024
1 parent c96315f commit 046a5ba
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/main/java/frc/robot/subsystems/Pneumatics.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
package frc.robot.subsystems;

import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import frc.robot.Constants.PneumaticConstants;
import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj2.command.SubsystemBase;

public class Pneumatics extends SubsystemBase {
DoubleSolenoid m_doubleSolenoid = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,
PneumaticConstants.kForwardChannel, PneumaticConstants.kReverseChannel);
Compressor m_compressor = new Compressor(PneumaticsModuleType.CTREPCM);
public Pneumatics() {
m_compressor.enableAnalog(100, 120);
}
DoubleSolenoid m_doubleSolenoid = new DoubleSolenoid(PneumaticsModuleType.CTREPCM, PneumaticConstants.kForwardChannel,
PneumaticConstants.kReverseChannel);

// may want to add a toggle option
public void extendPiston() {
m_doubleSolenoid.set(DoubleSolenoid.Value.kForward);
}

public void retractPiston() {
m_doubleSolenoid.set(DoubleSolenoid.Value.kForward);
m_doubleSolenoid.set(DoubleSolenoid.Value.kReverse);
}

public void setSolenoidOff() {
m_doubleSolenoid.set(DoubleSolenoid.Value.kForward);
m_doubleSolenoid.set(DoubleSolenoid.Value.kOff);
}

public void toggleSolenoid() {
Expand Down

0 comments on commit 046a5ba

Please sign in to comment.