-
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 #2 from NicoletFEAR/Game-Mech
Game mech
- Loading branch information
Showing
12 changed files
with
374 additions
and
37 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
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
44 changes: 44 additions & 0 deletions
44
Stronghold2016/src/com/nicoletfear/Stronghold2016/commands/ArmDown.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,44 @@ | ||
|
||
package com.nicoletfear.Stronghold2016.commands; | ||
|
||
import edu.wpi.first.wpilibj.command.Command; | ||
|
||
import com.nicoletfear.Stronghold2016.Robot; | ||
|
||
/** | ||
*Command that lowers arm. It stops when the user releases the | ||
*lower limit switch or releases the button | ||
*/ | ||
public class ArmDown extends Command { | ||
|
||
public ArmDown() { | ||
// Use requires() here to declare subsystem dependencies | ||
requires(Robot.arm); | ||
} | ||
|
||
// Called just before this Command runs the first time | ||
protected void initialize() { | ||
Robot.arm.armDown(); | ||
} | ||
|
||
// Called repeatedly when this Command is scheduled to run | ||
protected void execute() { | ||
|
||
} | ||
|
||
// Make this return true when this Command no longer needs to run execute() | ||
protected boolean isFinished() { | ||
return Robot.arm.downLimitSwitchPressed(); | ||
} | ||
|
||
// Called once after isFinished returns true | ||
protected void end() { | ||
Robot.arm.armStop(); | ||
} | ||
|
||
// Called when another command which requires one or more of the same | ||
// subsystems is scheduled to run | ||
protected void interrupted() { | ||
end(); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
Stronghold2016/src/com/nicoletfear/Stronghold2016/commands/ArmUp.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,43 @@ | ||
|
||
package com.nicoletfear.Stronghold2016.commands; | ||
|
||
import edu.wpi.first.wpilibj.command.Command; | ||
|
||
import com.nicoletfear.Stronghold2016.Robot; | ||
|
||
/** | ||
*Command that raises arm. It stops when the user releases the | ||
*upper limit switch or releases the button | ||
*/ | ||
public class ArmUp extends Command { | ||
|
||
public ArmUp() { | ||
// Use requires() here to declare subsystem dependencies | ||
requires(Robot.arm); | ||
} | ||
|
||
// Called just before this Command runs the first time | ||
protected void initialize() { | ||
Robot.arm.armUp(); | ||
} | ||
|
||
// Called repeatedly when this Command is scheduled to run | ||
protected void execute() { | ||
} | ||
|
||
// Make this return true when this Command no longer needs to run execute() | ||
protected boolean isFinished() { | ||
return Robot.arm.upLimitSwitchPressed(); | ||
} | ||
|
||
// Called once after isFinished returns true | ||
protected void end() { | ||
Robot.arm.armStop(); | ||
} | ||
|
||
// Called when another command which requires one or more of the same | ||
// subsystems is scheduled to run | ||
protected void interrupted() { | ||
end(); | ||
} | ||
} |
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
46 changes: 46 additions & 0 deletions
46
Stronghold2016/src/com/nicoletfear/Stronghold2016/commands/PassCommand.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,46 @@ | ||
|
||
package com.nicoletfear.Stronghold2016.commands; | ||
|
||
import edu.wpi.first.wpilibj.command.Command; | ||
|
||
import com.nicoletfear.Stronghold2016.Robot; | ||
import com.nicoletfear.Stronghold2016.xbox.Buttons; | ||
|
||
/** | ||
*this command passes the ball | ||
*/ | ||
public class PassCommand extends Command { | ||
|
||
public PassCommand() { | ||
// Use requires() here to declare subsystem dependencies | ||
requires(Robot.intake); | ||
} | ||
|
||
// Called just before this Command runs the first time | ||
protected void initialize() { | ||
Robot.intake.pass(); | ||
} | ||
|
||
// Called repeatedly when this Command is scheduled to run | ||
protected void execute() { | ||
|
||
//when A is pressed, starts passing | ||
//when A is released, stops intake from spinning | ||
} | ||
|
||
// 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() { | ||
Robot.intake.stopIntake(); | ||
} | ||
|
||
// Called when another command which requires one or more of the same | ||
// subsystems is scheduled to run | ||
protected void interrupted() { | ||
end(); | ||
} | ||
} |
Oops, something went wrong.