From: Cindy Zhang Date: Tue, 16 Feb 2016 23:30:20 +0000 (-0800) Subject: create new command to record pot angle when button pressed X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=3004ae835d048cd5f0d413b5f455a405b77e1761 create new command to record pot angle when button pressed --- diff --git a/src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java b/src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java new file mode 100644 index 00000000..bb9a0120 --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/intakearm/RecordPotAngle.java @@ -0,0 +1,43 @@ +package org.usfirst.frc.team3501.robot.commands.intakearm; + +import org.usfirst.frc.team3501.robot.Robot; + +import edu.wpi.first.wpilibj.command.Command; + +/** + * + */ +public class RecordPotAngle extends Command { + + public RecordPotAngle() { + requires(Robot.intakeArm); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + Robot.intakeArm.potAngles[0] = Robot.intakeArm.getArmAngle(); + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +}