From bfdca95893ad817ce1c2c4767fd1fee7b46d12ac Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Mon, 14 Nov 2022 18:40:56 -0500 Subject: [PATCH 1/3] gcbvcnv --- .../Pistonshaker.java} | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) rename src/main/java/frc/robot/{subsystem/pistonshaker.java => subsystems/Pistonshaker.java} (56%) diff --git a/src/main/java/frc/robot/subsystem/pistonshaker.java b/src/main/java/frc/robot/subsystems/Pistonshaker.java similarity index 56% rename from src/main/java/frc/robot/subsystem/pistonshaker.java rename to src/main/java/frc/robot/subsystems/Pistonshaker.java index 0157b86..eadd140 100644 --- a/src/main/java/frc/robot/subsystem/pistonshaker.java +++ b/src/main/java/frc/robot/subsystems/Pistonshaker.java @@ -2,13 +2,19 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -package frc.robot.subsystem; +package frc.robot.subsystems; +import edu.wpi.first.wpilibj.DoubleSolenoid; +import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj2.command.SubsystemBase; -public class pistonshaker extends SubsystemBase { +public class Pistonshaker extends SubsystemBase { + private DoubleSolenoid shaker = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,0,1); /** Creates a new pistonshaker. */ - public pistonshaker() {} + + public Pistonshaker() { + + } @Override public void periodic() { From bd4103944cb2100a677a288da940675022ba426a Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Mon, 14 Nov 2022 18:52:36 -0500 Subject: [PATCH 2/3] qwerty --- src/main/java/frc/robot/Constants.java | 5 ++++- src/main/java/frc/robot/subsystems/Pistonshaker.java | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 033c72d..23ef642 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -12,4 +12,7 @@ package frc.robot; *

It is advised to statically import this class (or one of its inner classes) wherever the * constants are needed, to reduce verbosity. */ -public final class Constants {} +public final class Constants { + public static final int pistonQuiShakef = 0; + public static final int pistonQuiShakeb = 1; +} diff --git a/src/main/java/frc/robot/subsystems/Pistonshaker.java b/src/main/java/frc/robot/subsystems/Pistonshaker.java index eadd140..d9eb538 100644 --- a/src/main/java/frc/robot/subsystems/Pistonshaker.java +++ b/src/main/java/frc/robot/subsystems/Pistonshaker.java @@ -7,9 +7,10 @@ package frc.robot.subsystems; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants; public class Pistonshaker extends SubsystemBase { - private DoubleSolenoid shaker = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,0,1); + private DoubleSolenoid shaker = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonQuiShakeb,Constants.pistonQuiShakef); /** Creates a new pistonshaker. */ public Pistonshaker() { From 8da918a7d2ab52ff5442835f9f446fc07fe2d1bd Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Mon, 14 Nov 2022 19:14:46 -0500 Subject: [PATCH 3/3] ngnhgcmvn --- src/main/java/frc/robot/Constants.java | 2 ++ src/main/java/frc/robot/subsystems/Pistonshaker.java | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 23ef642..5d2f693 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -4,6 +4,8 @@ package frc.robot; + + /** * The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean * constants. This class should not be used for any other purpose. All constants should be declared diff --git a/src/main/java/frc/robot/subsystems/Pistonshaker.java b/src/main/java/frc/robot/subsystems/Pistonshaker.java index d9eb538..5599ac6 100644 --- a/src/main/java/frc/robot/subsystems/Pistonshaker.java +++ b/src/main/java/frc/robot/subsystems/Pistonshaker.java @@ -6,19 +6,27 @@ package frc.robot.subsystems; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.PneumaticsModuleType; +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; public class Pistonshaker extends SubsystemBase { - private DoubleSolenoid shaker = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonQuiShakeb,Constants.pistonQuiShakef); + private DoubleSolenoid shaker = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonQuiShakef,Constants.pistonQuiShakeb); /** Creates a new pistonshaker. */ public Pistonshaker() { } - +public void sortirpiston() { + shaker.set(Value.kForward); +} +public void rentrerpiston() { + shaker.set(Value.kReverse); + } + @Override public void periodic() { + // This method will be called once per scheduler run } }