Skip to content

Commit

Permalink
Merge pull request #49 from prosa100/20_compressorSubsystem
Browse files Browse the repository at this point in the history
Added a compressor subsystem (#20): controls both solenoids and compressor
  • Loading branch information
joemahmah committed Jan 18, 2014
2 parents 0599e75 + 7bd9302 commit 64876c8
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
3 changes: 1 addition & 2 deletions frc2022_2014/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
This is a sample netbeans project file for a Sun Spot Application project.
You may edit it freely, it doesn't affect the ant-powered build.
-->
<project xmlns="http://www.netbeans.org/ns/project/1">
--><project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.ant.freeform</type>
<configuration>
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.usfirst.frc2022_2014.subsystems;

import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
*
* @author Michael
*/
public class CompressorSubsystem extends Subsystem {

private Compressor compressor;
private DoubleSolenoid dsol;

public CompressorSubsystem(int sol1Port, int sol2Port, int compSwitchChannel, int compRelayChannel){
compressor = new Compressor(compSwitchChannel, compRelayChannel);
dsol = new DoubleSolenoid(sol1Port, sol2Port);
}

public void start(){
compressor.start();
dsol.set(DoubleSolenoid.Value.kOff);
}

public void stop(){
dsol.set(DoubleSolenoid.Value.kOff);
compressor.stop();
}

public void closeSolenoid(){
dsol.set(DoubleSolenoid.Value.kOff);
}

public void forwardSolenoid(){
dsol.set(DoubleSolenoid.Value.kForward);
}

public void backwardSolenoid(){
dsol.set(DoubleSolenoid.Value.kReverse);
}

public void initDefaultCommand() {

}
}

0 comments on commit 64876c8

Please sign in to comment.