projects
/
3501
/
stronghold-2016
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
overload constructor
[3501/stronghold-2016]
/
src
/
org
/
usfirst
/
frc
/
team3501
/
robot
/
commands
/
driving
/
TurnForTime.java
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/driving/TurnForTime.java
b/src/org/usfirst/frc/team3501/robot/commands/driving/TurnForTime.java
index b1b37cdda46a014977db6638828348609acbb634..3ec3974d7b1fb9e9d64338cf4cad744c3a22e7da 100755
(executable)
--- a/
src/org/usfirst/frc/team3501/robot/commands/driving/TurnForTime.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/driving/TurnForTime.java
@@
-20,14
+20,20
@@
import edu.wpi.first.wpilibj.command.Command;
*/
public class TurnForTime extends Command {
*/
public class TurnForTime extends Command {
- private
final double
SPEED = 0.5;
+ private
static final double DEFAULT_
SPEED = 0.5;
private Direction direction;
private double seconds;
private Timer timer;
private Direction direction;
private double seconds;
private Timer timer;
+ private double speed;
- public TurnForTime(double seconds, Direction direction) {
+ public TurnForTime(double seconds, Direction direction
, double speed
) {
this.seconds = seconds;
this.direction = direction;
this.seconds = seconds;
this.direction = direction;
+ this.speed = speed;
+ }
+
+ public TurnForTime(double seconds, Direction direction) {
+ this(seconds, direction, DEFAULT_SPEED);
}
@Override
}
@Override
@@
-36,9
+42,9
@@
public class TurnForTime extends Command {
timer.start();
if (direction == Direction.RIGHT) {
timer.start();
if (direction == Direction.RIGHT) {
- Robot.driveTrain.setMotorSpeeds(
SPEED, -SPEED
);
+ Robot.driveTrain.setMotorSpeeds(
speed, -speed
);
} else if (direction == Direction.LEFT) {
} else if (direction == Direction.LEFT) {
- Robot.driveTrain.setMotorSpeeds(-
SPEED, SPEED
);
+ Robot.driveTrain.setMotorSpeeds(-
speed, speed
);
}
}
}
}