Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Robot2019/src/main/java/frc/robot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import frc.robot.commands.Climb;
import frc.robot.commands.EjectCargo;
import frc.robot.commands.IntakeOnlyCargo;
import frc.robot.commands.SetArcadeOrTank;
import frc.robot.commands.SlowDrive;
import frc.robot.commands.ToggleCamera;
import frc.robot.commands.ToggleHatch;
Expand All @@ -32,6 +33,7 @@ public class OI {
Joystick leftJoy, rightJoy, manipulator;

JoystickButton leftSlowBtn, rightSlowBtn;
JoystickButton arcadeOrTankBtn;
JoystickButton normDriveBtn;
JoystickButton toggleHatchBtn;
JoystickButton cargoIntakeBtn, cargoEjectBtn;
Expand All @@ -50,6 +52,8 @@ public class OI {
rightSlowBtn = new JoystickButton(rightJoy, 1);
rightSlowBtn.whileHeld(new SlowDrive(SlowDrive.Side.RIGHT));

arcadeOrTankBtn = new JoystickButton(leftJoy, 4);
arcadeOrTankBtn.whenPressed(new SetArcadeOrTank());
normDriveBtn = new JoystickButton(leftJoy, 3);
normDriveBtn.whileHeld(new NormalDrive());

Expand Down
19 changes: 19 additions & 0 deletions Robot2019/src/main/java/frc/robot/commands/SetArcadeOrTank.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package frc.robot.commands;

import edu.wpi.first.wpilibj.command.InstantCommand;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class SetArcadeOrTank extends InstantCommand {
public SetArcadeOrTank() {

}

protected void initialize() {
if (SmartDashboard.getBoolean("Arcade Drive", true)) {
SmartDashboard.putBoolean("Arcade Drive", false);
} else {
SmartDashboard.putBoolean("Arcade Drive", true);
}

}
}