334fa0b67d278ad2dd38afe3be68d54fd6487b09
1 package org
.usfirst
.frc
.team3501
.robot
.commands
.driving
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
.Direction
;
4 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
6 import edu
.wpi
.first
.wpilibj
.command
.Command
;
9 * This command turns the robot for a specified angle in specified direction -
10 * either left or right
13 * angle: the robot will turn - in degrees
14 * direction: the robot will turn - either right or left
15 * motorVal: the motor input to set the motors to
17 public class TurnForAngle
extends Command
{
19 public TurnForAngle(double angle
, Direction direction
, double motorVal
) {
20 requires(Robot
.getDriveTrain());
23 // Called just before this Command runs the first time
25 protected void initialize() {
28 // Called repeatedly when this Command is scheduled to run
30 protected void execute() {
33 // Make this return true when this Command no longer needs to run execute()
35 protected boolean isFinished() {
39 // Called once after isFinished returns true
41 protected void end() {
44 // Called when another command which requires one or more of the same
45 // subsystems is scheduled to run
47 protected void interrupted() {