Skip to content

Commit

Permalink
Changed some words
Browse files Browse the repository at this point in the history
Camel case n stuff
  • Loading branch information
Dark-IsHere committed Feb 5, 2024
1 parent 90b7844 commit 7547403
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
9 changes: 8 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import frc.robot.commands.SetShooter;
import frc.robot.subsystems.ArnavIntake.IntakeStates;
import frc.robot.subsystems.ArnavShooter.ShooterStates;
import frc.robot.subsystems.ArnavIndexer;
import frc.robot.subsystems.ArnavIntake;
import frc.robot.subsystems.ArnavShooter;
// import frc.robot.commands.Autos;
// import frc.robot.commands.ExampleCommand;
// import frc.robot.commands.TeleopSwerve;
Expand All @@ -30,6 +33,9 @@ public class RobotContainer {
private final Swerve s_Swerve = Swerve.getInstance();
//private final IntakeShooter s_IntakeShooter = IntakeShooter.getInstance();
//private final Pivot s_Pivot = Pivot.getInstance();
private final ArnavIndexer s_ArnavIndexer = ArnavIndexer.getInstance();
private final ArnavIntake s_ArnavIntake = ArnavIntake.getInstance();
private final ArnavShooter s_ArnavShooter = ArnavShooter.getInstance();

private final XboxController driver = new XboxController(0);
private final XboxController operator = new XboxController(1);
Expand Down Expand Up @@ -119,7 +125,7 @@ private void configureBindings() {
// driverY.whileTrue(s_Swerve.sysIdDynamic(SysIdRoutine.Direction.kReverse));

// shooter
operatorDpadUp.onTrue(maxShooter());
operatorDpadUp.onTrue(new InstantCommand(() -> s_ArnavIndexer.setSpeed(0.5))); // An instant command just for testing right now
operatorDpadDown.onTrue(offShooter());
operatorDpadRight.whileTrue(increaseShooter());
operatorDpadLeft.whileTrue(decreaseShooter());
Expand All @@ -141,6 +147,7 @@ private void configureBindings() {
* @return the command to run in autonomous
*/


//shooter
public Command maxShooter() {
return new SetShooter(ShooterStates.MAX);
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/frc/robot/commands/SetShooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@

public class SetShooter extends Command {
private final ArnavShooter s_ArnavShooter;
double finalspeed;
double finalSpeed;

public SetShooter(ArnavShooter.ShooterStates state) { //change from off or max speed
s_ArnavShooter = ArnavShooter.getInstance();
finalspeed = state.getValue();
finalSpeed = state.getValue();
addRequirements(s_ArnavShooter);
}

public SetShooter(double difference) { //increase or decrease speed. Makes sure not to increase above max or decrease below 0
s_ArnavShooter = ArnavShooter.getInstance();

double addedspeed = s_ArnavShooter.getspeed() + difference;
double addedSpeed = s_ArnavShooter.getSpeed() + difference;

if(addedspeed <= 1 && addedspeed >= 0) {
finalspeed = addedspeed;
if(addedSpeed <= 1 && addedSpeed >= 0) {
finalSpeed = addedSpeed;
}

addRequirements(s_ArnavShooter);
Expand All @@ -34,7 +34,7 @@ public void initialize() {

@Override
public void execute() {
s_ArnavShooter.setspeed(finalspeed);
s_ArnavShooter.setSpeed(finalSpeed);
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/subsystems/ArnavIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public void setSpeed(IndexerStates state) {
this.state = state.name();
}

public void setSpeed(double speed) {
indexerM.set(speed);
}

@Override
public void periodic() {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/frc/robot/subsystems/ArnavShooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ public double getValue() {

}

public void setspeed(ShooterStates state) { //change state
public void setSpeed(ShooterStates state) { //change state
shooterLeaderM.set(state.speed);
currentSpeed = state.getValue();
}

public void setspeed(double newspeed) { //change specific speed
shooterFollowerM.set(newspeed);
currentSpeed = newspeed;
public void setSpeed(double newSpeed) { //change specific Speed
shooterLeaderM.set(newSpeed);
currentSpeed = newSpeed;
}

public double getspeed() { //gets specific speed (i hope)
public double getSpeed() { //gets specific Speed (i hope)
return currentSpeed;
}

Expand Down

0 comments on commit 7547403

Please sign in to comment.