-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from prosa100/feature/21-compressor-etc
Issue #21: added compressor command and made some fixes to deal with mec...
- Loading branch information
Showing
5 changed files
with
181 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,92 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<!-- | ||
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"> | ||
<type>org.netbeans.modules.ant.freeform</type> | ||
<configuration> | ||
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> | ||
<name>frc2022_2014</name> | ||
<properties> | ||
<property-file>${user.home}/.sunspotfrc.properties</property-file> | ||
<property-file>build.properties</property-file> | ||
<property-file>${sunspot.home}/default.properties</property-file> | ||
</properties> | ||
<folders> | ||
<source-folder> | ||
<label>src</label> | ||
<type>java</type> | ||
<location>src</location> | ||
</source-folder> | ||
</folders> | ||
<ide-actions> | ||
<action name="build"> | ||
<target>jar-app</target> | ||
</action> | ||
<action name="clean"> | ||
<target>clean</target> | ||
</action> | ||
<action name="run"> | ||
<target>deploy</target> | ||
<target>run</target> | ||
</action> | ||
<action name="rebuild"> | ||
<target>clean</target> | ||
<target>jar-app</target> | ||
</action> | ||
<action name="debug"> | ||
<target>deploy</target> | ||
<target>debug-run</target> | ||
</action> | ||
<action name="javadoc"> | ||
<target>javadoc</target> | ||
</action> | ||
</ide-actions> | ||
<export> | ||
<type>folder</type> | ||
<location>build</location> | ||
<build-target>jar-app</build-target> | ||
</export> | ||
<view> | ||
<items> | ||
<source-folder style="packages"> | ||
<label>src</label> | ||
<location>src</location> | ||
</source-folder> | ||
<source-file> | ||
<location>build.xml</location> | ||
</source-file> | ||
</items> | ||
<context-menu> | ||
<ide-action name="build"/> | ||
<ide-action name="clean"/> | ||
<ide-action name="run"/> | ||
<ide-action name="rebuild"/> | ||
<ide-action name="debug"/> | ||
<ide-action name="javadoc"/> | ||
<action> | ||
<label>Sun SPOT-deploy</label> | ||
<target>deploy</target> | ||
</action> | ||
<action> | ||
<label>Sun SPOT-jar-deploy</label> | ||
<target>jar-deploy</target> | ||
</action> | ||
<separator/> | ||
</context-menu> | ||
</view> | ||
<subprojects/> | ||
</general-data> | ||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"> | ||
<compilation-unit> | ||
<package-root>src</package-root> | ||
<classpath mode="boot">${sunspot.home}\lib\squawk.jar</classpath> | ||
<classpath mode="compile">${sunspot.home}\lib\wpilibj.jar;${sunspot.home}\lib\networktables-crio.jar</classpath> | ||
<built-to>build</built-to> | ||
<source-level>1.4</source-level> | ||
</compilation-unit> | ||
</java-data> | ||
</configuration> | ||
</project> | ||
--><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"> | ||
<name>frc2022_2014</name> | ||
<properties> | ||
<property-file>${user.home}/.sunspotfrc.properties</property-file> | ||
<property-file>build.properties</property-file> | ||
<property-file>${sunspot.home}/default.properties</property-file> | ||
</properties> | ||
<folders> | ||
<source-folder> | ||
<label>src</label> | ||
<type>java</type> | ||
<location>src</location> | ||
</source-folder> | ||
</folders> | ||
<ide-actions> | ||
<action name="build"> | ||
<target>jar-app</target> | ||
</action> | ||
<action name="clean"> | ||
<target>clean</target> | ||
</action> | ||
<action name="run"> | ||
<target>deploy</target> | ||
<target>run</target> | ||
</action> | ||
<action name="rebuild"> | ||
<target>clean</target> | ||
<target>jar-app</target> | ||
</action> | ||
<action name="debug"> | ||
<target>deploy</target> | ||
<target>debug-run</target> | ||
</action> | ||
<action name="javadoc"> | ||
<target>javadoc</target> | ||
</action> | ||
</ide-actions> | ||
<export> | ||
<type>folder</type> | ||
<location>build</location> | ||
<build-target>jar-app</build-target> | ||
</export> | ||
<view> | ||
<items> | ||
<source-folder style="packages"> | ||
<label>src</label> | ||
<location>src</location> | ||
</source-folder> | ||
<source-file> | ||
<location>build.xml</location> | ||
</source-file> | ||
</items> | ||
<context-menu> | ||
<ide-action name="build"/> | ||
<ide-action name="clean"/> | ||
<ide-action name="run"/> | ||
<ide-action name="rebuild"/> | ||
<ide-action name="debug"/> | ||
<ide-action name="javadoc"/> | ||
<action> | ||
<label>Sun SPOT-deploy</label> | ||
<target>deploy</target> | ||
</action> | ||
<action> | ||
<label>Sun SPOT-jar-deploy</label> | ||
<target>jar-deploy</target> | ||
</action> | ||
<separator/> | ||
</context-menu> | ||
</view> | ||
<subprojects/> | ||
</general-data> | ||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"> | ||
<compilation-unit> | ||
<package-root>src</package-root> | ||
<classpath mode="boot">${sunspot.home}/lib/squawk.jar</classpath> | ||
<classpath mode="compile">${sunspot.home}/lib/wpilibj.jar:${sunspot.home}/lib/networktables-crio.jar</classpath> | ||
<built-to>build</built-to> | ||
<source-level>1.4</source-level> | ||
</compilation-unit> | ||
</java-data> | ||
</configuration> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
frc2022_2014/src/org/usfirst/frc2022_2014/commands/CompressorController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.usfirst.frc2022_2014.commands; | ||
|
||
/** | ||
* | ||
1) Turn back solenoid | ||
2) Turn on electromagnet (relay) | ||
3) Wait until fully back (limit switch) | ||
4) Turn forward solenoid | ||
The two subsystems for the pinball shooter and the compressor should be merged | ||
* | ||
* @author Emma | ||
*/ | ||
public class CompressorController extends CommandBase { | ||
|
||
public CompressorController(){ | ||
requires(compressor); | ||
|
||
} | ||
|
||
// Called just before this Command runs the first time | ||
protected void initialize() { | ||
compressor.relayOn(); | ||
} | ||
|
||
// Called repeatedly when this Command is scheduled to run | ||
protected void execute() { | ||
compressor.backwardSolenoid(); | ||
} | ||
|
||
// Make this return true when this Command no longer needs to run execute() | ||
protected boolean isFinished() { | ||
return false; | ||
} | ||
|
||
// Called once after isFinished returns true | ||
protected void end() { | ||
if(compressor.pistonOut()){ | ||
compressor.forwardSolenoid(); | ||
compressor.stop(); | ||
} | ||
} | ||
|
||
// Called when another command which requires one or more of the same | ||
// subsystems is scheduled to run | ||
protected void interrupted() { | ||
compressor.stop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters