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

Commit 294c82b

Browse files
committed
forgot the command and associated button :)
1 parent 144f0d8 commit 294c82b

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Robot2018/src/org/usfirst/frc/team199/Robot2018/OI.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.usfirst.frc.team199.Robot2018.commands.AutoLift;
1111
import org.usfirst.frc.team199.Robot2018.commands.FindTurnTimeConstant;
1212
import org.usfirst.frc.team199.Robot2018.commands.IntakeCube;
13+
import org.usfirst.frc.team199.Robot2018.commands.InvertDrivetrain;
1314
import org.usfirst.frc.team199.Robot2018.commands.MoveLift;
1415
import org.usfirst.frc.team199.Robot2018.commands.MoveLiftWithPID;
1516
import org.usfirst.frc.team199.Robot2018.commands.OuttakeCube;
@@ -55,6 +56,7 @@ public class OI {
5556
private JoystickButton findTurnTimeConstantButton;
5657
private JoystickButton updatePIDConstantsButton;
5758
private JoystickButton updateEncoderDPPButton;
59+
private JoystickButton invertDTButton;
5860

5961
public Joystick manipulator;
6062
private JoystickButton closeIntakeButton;
@@ -83,6 +85,9 @@ public OI(Robot robot) {
8385
shiftDriveTypeButton = new JoystickButton(leftJoy, getButton("Shift Drive Type", 2));
8486
shiftDriveTypeButton.whenPressed(new ShiftDriveType());
8587

88+
invertDTButton = new JoystickButton(leftJoy, getButton("Invert Drivetrain", 3));
89+
invertDTButton.whenPressed(new InvertDrivetrain());
90+
8691
pIDMoveButton = new JoystickButton(leftJoy, getButton("PID Move", 7));
8792
pIDMoveButton
8893
.whenPressed(new PIDMove(Robot.sd.getConst("Move Targ", 24), Robot.dt, Robot.sd, RobotMap.distEncAvg));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.usfirst.frc.team199.Robot2018.commands;
2+
3+
import org.usfirst.frc.team199.Robot2018.Robot;
4+
5+
import edu.wpi.first.wpilibj.command.InstantCommand;
6+
7+
/**
8+
*
9+
*/
10+
public class InvertDrivetrain extends InstantCommand {
11+
12+
public InvertDrivetrain() {
13+
// Use requires() here to declare subsystem dependencies
14+
// eg. requires(chassis);
15+
super();
16+
}
17+
18+
// Called just before this Command runs the first time
19+
@Override
20+
protected void initialize() {
21+
Robot.dt.reverseDT();
22+
}
23+
}

0 commit comments

Comments
 (0)