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

Commit 99141aa

Browse files
committed
implemented realtime distperpulse update
1 parent 344904a commit 99141aa

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

  • Robot2018/src/org/usfirst/frc/team199/Robot2018

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
package org.usfirst.frc.team199.Robot2018;
99

10-
import org.usfirst.frc.team199.Robot2018.commands.ShiftDriveType;
11-
import org.usfirst.frc.team199.Robot2018.commands.ShiftLowGear;
12-
import org.usfirst.frc.team199.Robot2018.commands.UpdatePIDConstants;
10+
import org.usfirst.frc.team199.Robot2018.commands.*;
1311

1412
import edu.wpi.first.wpilibj.Joystick;
1513
import edu.wpi.first.wpilibj.buttons.JoystickButton;
@@ -49,10 +47,12 @@ public class OI {
4947
// button.whenReleased(new ExampleCommand());
5048

5149
public Joystick leftJoy;
52-
private JoystickButton shiftDrive;
50+
private JoystickButton shiftLowGear;
51+
private JoystickButton shiftHighGear;
5352
private JoystickButton shiftDriveType;
5453
public Joystick rightJoy;
5554
private JoystickButton updatePidConstants;
55+
private JoystickButton updateEncoderDPP;
5656
public Joystick manipulator;
5757

5858
public int getButton(String key, int def) {
@@ -64,14 +64,18 @@ public int getButton(String key, int def) {
6464

6565
public OI() {
6666
leftJoy = new Joystick(0);
67-
shiftDrive = new JoystickButton(leftJoy, getButton("Shift Drive", 1));
68-
shiftDrive.whenPressed(new ShiftLowGear());
67+
shiftLowGear = new JoystickButton(leftJoy, getButton("Shift Low Gear", 3));
68+
shiftLowGear.whenPressed(new ShiftLowGear());
69+
shiftHighGear = new JoystickButton(leftJoy, getButton("Shift High Gear", 5));
70+
shiftHighGear.whenPressed(new ShiftHighGear());
6971
shiftDriveType = new JoystickButton(leftJoy, getButton("Shift Drive Type", 2));
7072
shiftDriveType.whenPressed(new ShiftDriveType());
7173

7274
rightJoy = new Joystick(1);
7375
updatePidConstants = new JoystickButton(rightJoy, getButton("Get PID Constants", 8));
7476
updatePidConstants.whenPressed(new UpdatePIDConstants());
77+
updateEncoderDPP = new JoystickButton(rightJoy, getButton("Get Encoder Dist Per Pulse", 9));
78+
updateEncoderDPP.whenPressed(new SetDistancePerPulse());
7579

7680
manipulator = new Joystick(2);
7781
}

0 commit comments

Comments
 (0)