Skip to content

Commit

Permalink
Added ControlSystem subsystem to handle compressor, PDP
Browse files Browse the repository at this point in the history
  • Loading branch information
briansemrau committed Feb 28, 2018
1 parent 8ebb57e commit 51d4ccf
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/org/usfirst/frc/team4737/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@

import org.usfirst.frc.team4737.robot.commands.drivetrain.AutoBlindBaseline;
import org.usfirst.frc.team4737.robot.commands.drivetrain.RelaxDrivetrain;
import org.usfirst.frc.team4737.robot.subsystems.Climber;
import org.usfirst.frc.team4737.robot.subsystems.Drivetrain;
import org.usfirst.frc.team4737.robot.subsystems.Elevator;
import org.usfirst.frc.team4737.robot.subsystems.Intake;
import org.usfirst.frc.team4737.robot.subsystems.*;

import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.command.Command;
Expand All @@ -33,6 +30,7 @@ public class Robot extends TimedRobot {
public static final Elevator ELEVATOR = new Elevator();
public static final Intake INTAKE = new Intake();
public static final Climber CLIMBER = new Climber();
public static final ControlSystem CONTROLSYSTEM = new ControlSystem();

public static final OI OI = new OI(); // Must initialize after subsystems

Expand Down
36 changes: 36 additions & 0 deletions src/org/usfirst/frc/team4737/robot/subsystems/ControlSystem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package org.usfirst.frc.team4737.robot.subsystems;

import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.PowerDistributionPanel;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
*
*/
public class ControlSystem extends Subsystem {

private Compressor compressor;
public PowerDistributionPanel pdp;

public ControlSystem() {
compressor = new Compressor(0);
pdp = new PowerDistributionPanel();

// Enable the compressor
enableCompressor();
}

public void initDefaultCommand() {
// Set the default command for a subsystem here.
// setDefaultCommand(new MySpecialCommand());
}

public void enableCompressor() {
compressor.setClosedLoopControl(true);
}

public void disableCompressor() {
compressor.setClosedLoopControl(false);
}

}

0 comments on commit 51d4ccf

Please sign in to comment.