Skip to content

Commit

Permalink
added fire method
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexwen709 committed Feb 3, 2024
1 parent fc79652 commit 1955426
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ public class CollectorSubsystem extends BaseSubsystem implements DataFrameRefres
private IntakeState intakeState;
private final XDigitalInput noteSensor;
private final ElectricalContract contract;
private final DoubleProperty firePower;


public enum IntakeState {
INTAKING,
EJECTING,
STOPPED
STOPPED,
FIRING
}

@Inject
Expand All @@ -40,7 +42,7 @@ public CollectorSubsystem(PropertyFactory pf, XCANSparkMax.XCANSparkMaxFactory s
pf.setPrefix(this);
intakePower = pf.createPersistentProperty("intakePower",0.1);
ejectPower = pf.createPersistentProperty("ejectPower",0.1);

firePower = pf.createPersistentProperty("firePower", 0.1);
this.intakeState = IntakeState.STOPPED;
}

Expand All @@ -59,7 +61,10 @@ public void stop(){
collectorMotor.set(0);
intakeState = IntakeState.STOPPED;
}

public void fire(){
collectorMotor.set(firePower.get());
intakeState = IntakeState.FIRING;
}
public boolean getGamePieceCollected() {
return noteSensor.get();
}
Expand Down

0 comments on commit 1955426

Please sign in to comment.