Skip to content

Commit d9d0273

Browse files
committed
added AirCompresorDefault
1 parent 74c594e commit d9d0273

File tree

4 files changed

+59
-4
lines changed

4 files changed

+59
-4
lines changed

src/main/java/org/mayheminc/robot2020/RobotContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class RobotContainer {
3737
public static final Intake intake = new Intake();
3838
public static final Autonomous autonomous = new Autonomous();
3939
public static final Targeting targeting = new Targeting();
40-
// public static final Compressor compressor = new Compressor();
40+
public static final AirCompressor compressor = new AirCompressor();
4141
public static PidTuner pidtuner;
4242
public static final Chimney chimney = new Chimney();
4343

@@ -152,7 +152,7 @@ private void configureOperatorPadButtons() {
152152
// new ShooterAdjustWheel(+100));
153153
OPERATOR_PAD.OPERATOR_PAD_BUTTON_FOUR.whenPressed(new IntakeSetPosition(RobotContainer.intake.PIVOT_UP));
154154
// new ShooterSetWheel(1000));
155-
OPERATOR_PAD.OPERATOR_PAD_BUTTON_FIVE.whileHeld(new MagazineSetChimney(1.0));
155+
OPERATOR_PAD.OPERATOR_PAD_BUTTON_FIVE.whileHeld(new ChimneySetChimney(1.0));
156156
OPERATOR_PAD.OPERATOR_PAD_BUTTON_SIX.whileHeld(new IntakeSetRollers(-1.0));
157157

158158
OPERATOR_PAD.OPERATOR_PAD_BUTTON_EIGHT.whileHeld(new IntakeSetRollers(1.0));
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*----------------------------------------------------------------------------*/
2+
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
3+
/* Open Source Software - may be modified and shared by FRC teams. The code */
4+
/* must be accompanied by the FIRST BSD license file in the root directory of */
5+
/* the project. */
6+
/*----------------------------------------------------------------------------*/
7+
8+
package org.mayheminc.robot2020.commands;
9+
10+
import org.mayheminc.robot2020.RobotContainer;
11+
12+
import edu.wpi.first.wpilibj2.command.CommandBase;
13+
14+
public class AirCompressorDefault extends CommandBase {
15+
/**
16+
* Creates a new AirCompressorDefault.
17+
*/
18+
public AirCompressorDefault() {
19+
// Use addRequirements() here to declare subsystem dependencies.
20+
}
21+
22+
// Called when the command is initially scheduled.
23+
@Override
24+
public void initialize() {
25+
// robot.is
26+
RobotContainer.compressor.setCompresor(true);
27+
}
28+
29+
// Called every time the scheduler runs while the command is scheduled.
30+
@Override
31+
public void execute() {
32+
}
33+
34+
// Called once the command ends or is interrupted.
35+
@Override
36+
public void end(boolean interrupted) {
37+
}
38+
39+
// Returns true when the command should end.
40+
@Override
41+
public boolean isFinished() {
42+
return false;
43+
}
44+
}

src/main/java/org/mayheminc/robot2020/commands/MagazineSetTurntable.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import org.mayheminc.robot2020.RobotContainer;
1111

12+
import edu.wpi.first.wpilibj.Talon;
1213
import edu.wpi.first.wpilibj2.command.CommandBase;
1314

1415
public class MagazineSetTurntable extends CommandBase {

src/main/java/org/mayheminc/robot2020/subsystems/Compressor.java renamed to src/main/java/org/mayheminc/robot2020/subsystems/AirCompressor.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,24 @@
77

88
package org.mayheminc.robot2020.subsystems;
99

10+
import edu.wpi.first.wpilibj.Compressor;
1011
import edu.wpi.first.wpilibj2.command.SubsystemBase;
1112

12-
public class compressor extends SubsystemBase {
13+
public class AirCompressor extends SubsystemBase {
14+
Compressor compressor = new Compressor();
15+
1316
/**
1417
* Creates a new compressor.
1518
*/
16-
public compressor() {
19+
public AirCompressor() {
20+
}
1721

22+
public void setCompresor(boolean b) {
23+
if (b) {
24+
compressor.start();
25+
} else {
26+
compressor.stop();
27+
}
1828
}
1929

2030
@Override

0 commit comments

Comments
 (0)