Skip to content

Commit

Permalink
Merge pull request #2 from frc937/double-solenoid
Browse files Browse the repository at this point in the history
Double solenoid
  • Loading branch information
Berdenson committed Feb 1, 2024
2 parents 7b2febc + 439e449 commit 463008a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
* project.
*/
public class Robot extends TimedRobot {
public DoubleSolenoid solenoid;
public DoubleSolenoid solenoid1;
public DoubleSolenoid solenoid2;
public XboxController controller;

/**
Expand All @@ -33,7 +34,8 @@ public class Robot extends TimedRobot {
*/
@Override
public void robotInit() {
solenoid = new DoubleSolenoid(PneumaticsModuleType.CTREPCM, 6, 7);
solenoid1 = new DoubleSolenoid(PneumaticsModuleType.CTREPCM, 6, 7);
solenoid2 = new DoubleSolenoid(PneumaticsModuleType.CTREPCM, 4, 5);
controller = new XboxController(0);
}

Expand Down Expand Up @@ -72,11 +74,14 @@ public void teleopInit() {}
@Override
public void teleopPeriodic() {
if (controller.getPOV() == 0 || controller.getPOV() == 360) {
solenoid.set(Value.kForward);
solenoid1.set(Value.kForward);
solenoid2.set(Value.kForward);
} else if (controller.getPOV() == 180) {
solenoid.set(Value.kReverse);
solenoid1.set(Value.kReverse);
solenoid2.set(Value.kReverse);
} else if (controller.getAButton()) {
solenoid.set(Value.kOff);
solenoid1.set(Value.kOff);
solenoid2.set(Value.kOff);
}
}

Expand Down

0 comments on commit 463008a

Please sign in to comment.