Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit 1838d1d

Browse files
committed
fixed DT stuff
bug in tank drive relating to button 1 on joysticks for slower drive made inverted DT for tank drive work
1 parent 85fe1a0 commit 1838d1d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/Drivetrain.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,17 @@ public void arcadeDrive(double speed, double turn) {
298298
*/
299299
@Override
300300
public void tankDrive(double leftSpeed, double rightSpeed) {
301-
if (Robot.oi.leftJoy.getRawButton(1) || Robot.oi.rightJoy.getRawButton(1)) {
301+
if (Robot.oi.leftJoy.getRawButton(1)) {
302302
leftSpeed *= Robot.getConst("Speed Slow Ratio", 0.5);
303+
}
304+
if (Robot.oi.rightJoy.getRawButton(1)) {
303305
rightSpeed *= Robot.getConst("Speed Slow Ratio", 0.5);
304306
}
307+
if (isInverted) {
308+
double leftSpd = leftSpeed;
309+
leftSpeed = rightSpeed;
310+
rightSpeed = leftSpd;
311+
}
305312
robotDrive.tankDrive(inverted * leftSpeed, inverted * rightSpeed, Robot.getBool("Square Drive Values", false));
306313
}
307314

0 commit comments

Comments
 (0)