Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
Moved value to initialize function in AlignTurn
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayernam committed Mar 19, 2016
1 parent e1d9878 commit b2e592c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/org/usfirst/frc/team2729/robot/autoModes/AlignTurn.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ public class AlignTurn extends Command{
* + is right, - is left
*/
public AlignTurn(double speed){
_amount = (int)(Robot.vision.findCrosshairHorizontalAngle(3) * ANGLE_TICKS_RATIO);
_amount = 0;
_power = speed;
}

}
@Override
protected void interrupted() {end();}
@Override
protected void initialize() {
Robot.driveTrain.resetLeftEnc();
Robot.driveTrain.resetRightEnc();
_amount = (int)(Robot.vision.findCrosshairHorizontalAngle(3) * ANGLE_TICKS_RATIO);
}
@Override
protected void execute() {Robot.driveTrain.tankDrive(_power * (_amount>0 ? 1 :-1), _power * (_amount>0 ? 1 : -1));}
Expand Down

0 comments on commit b2e592c

Please sign in to comment.