Skip to content

Commit

Permalink
feat: added safety rumbles to shooting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan4545 committed Sep 24, 2021
1 parent 0792492 commit 9418937
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"**/.factorypath": true,
"**/*~": true
},
"java.checkstyle.configuration": "${workspaceFolder}\\checkstyle.xml"
"java.checkstyle.configuration": "${workspaceFolder}\\checkstyle.xml",
"cSpell.words": [
"Tele"
]
}
9 changes: 7 additions & 2 deletions src/main/java/frc/robot/commands/Shoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc.robot.RobotContainer;
import frc.robot.subsystems.Cannon;
import edu.wpi.first.wpilibj.GenericHID.RumbleType;

public class Shoot extends CommandBase {
// Cannon
Expand All @@ -19,11 +20,13 @@ public class Shoot extends CommandBase {
* @param cannon Cannon Object.
* @param rc RobotContainer Object.
*/
public Shoot(Cannon cannon, RobotContainer rc) {
public Shoot(Cannon cannon, RobotContainer container) {
this.cannon = cannon;
this.rc = rc;
this.rc = container;

addRequirements(cannon);
container.joy.setRumble(RumbleType.kLeftRumble, 1.0);
container.joy.setRumble(RumbleType.kRightRumble, 1.0);
}

@Override
Expand All @@ -48,6 +51,8 @@ public void execute() {}
public void end(boolean interrupted) {
// Close when finished
this.cannon.close();
this.rc.joy.setRumble(RumbleType.kLeftRumble, 0.0);
this.rc.joy.setRumble(RumbleType.kRightRumble, 0.0);
}

@Override
Expand Down

0 comments on commit 9418937

Please sign in to comment.