X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fdoublejointeddefensearm%2FLowerDoubleJointedDefenseWristContinuous.java;fp=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fdoublejointeddefensearm%2FLowerDoubleJointedDefenseWristContinuous.java;h=6a193842a486532d3ed5210c8467b95a5d149e38;hb=1fe8448700c9ee28dd32df94e56d28a79d4f8ead;hp=0000000000000000000000000000000000000000;hpb=60fa3e53be375f99b4a5f5d97515987db1905935;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/commands/doublejointeddefensearm/LowerDoubleJointedDefenseWristContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/doublejointeddefensearm/LowerDoubleJointedDefenseWristContinuous.java new file mode 100755 index 00000000..6a193842 --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/doublejointeddefensearm/LowerDoubleJointedDefenseWristContinuous.java @@ -0,0 +1,46 @@ +package org.usfirst.frc.team3501.robot.commands.doublejointeddefensearm; + +import org.usfirst.frc.team3501.robot.Robot; + +import edu.wpi.first.wpilibj.command.Command; + +/*** + * This command is intended to be run from OI using button.whileHeld(...). + * It lowers the defenseWrist continually while the button is being held down. + * + * @author shaina + * + */ +public class LowerDoubleJointedDefenseWristContinuous extends Command { + + private double speed; + + public LowerDoubleJointedDefenseWristContinuous(double speed) { + requires(Robot.defenseArm); + this.speed = -speed; + } + + @Override + protected void initialize() { + Robot.defenseArm.setHandSpeed(speed); + } + + @Override + protected void execute() { + } + + @Override + protected boolean isFinished() { + return true; + } + + @Override + protected void end() { + Robot.defenseArm.setHandSpeed(0); + } + + @Override + protected void interrupted() { + end(); + } +}