Skip to content

Commit

Permalink
[#483] changed (easy)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meh243 committed Mar 23, 2024
1 parent b327522 commit 66a21f6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/frc/robot/subsystems/Indexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Indexer extends SubsystemBase {

private Collector collector;

private ThunderBird indexerMotor;
private ThunderBird motor;
private DigitalInput indexerSensorEntry = new DigitalInput(DIO.INDEXER_ENTER_BEAMBREAK);
private DigitalInput indexerSensorExit = new DigitalInput(DIO.INDEXER_EXIT_BEAMBREAK);

Expand Down Expand Up @@ -51,13 +51,13 @@ public class Indexer extends SubsystemBase {
public Indexer(Collector collector) {
this.collector = collector;

indexerMotor = new ThunderBird(CAN.INDEXER_MOTOR, CAN.CANBUS_FD,
motor = new ThunderBird(CAN.INDEXER_MOTOR, CAN.CANBUS_FD,
IndexerConstants.MOTOR_INVERT, IndexerConstants.MOTOR_STATOR_CURRENT_LIMIT,
IndexerConstants.INDEXER_MOTOR_BRAKE_MODE);
indexerMotor.configSupplyLimit(0d);
indexerMotor.configStatorLimit(80d);
motor.configSupplyLimit(0d);
motor.configStatorLimit(80d);

indexerMotor.applyConfig();
motor.applyConfig();

initLogging();
}
Expand All @@ -77,7 +77,7 @@ private void initLogging() {
isExitingLog = new BooleanLogEntry(log, "/Indexer/IsExiting");
hasPieceLog = new BooleanLogEntry(log, "/Indexer/HasPiece");

LightningShuffleboard.setDoubleSupplier("Indexer", "Power", () -> indexerMotor.get());
LightningShuffleboard.setDoubleSupplier("Indexer", "Power", () -> motor.get());

LightningShuffleboard.setBoolSupplier("Indexer", "EntryBeamBreak", () -> getEntryBeamBreakState());
LightningShuffleboard.setBoolSupplier("Indexer", "ExitBeamBreak", () -> getExitBeamBreakState());
Expand Down Expand Up @@ -114,7 +114,7 @@ public void setPieceState(PieceState state) {
*/
public void setPower(double power) {
targetPower = power;
indexerMotor.setControl(dutyCycleControl.withOutput(power));
motor.setControl(dutyCycleControl.withOutput(power));
}

/**
Expand All @@ -123,7 +123,7 @@ public void setPower(double power) {
* @return current power of the indexer motor
*/
public double getPower() {
return indexerMotor.get();
return motor.get();
}

/**
Expand Down Expand Up @@ -200,7 +200,7 @@ public void clearHasShot() {
* @return current power of the indexer motor
*/
public double getIndexerPower() {
return indexerMotor.get();
return motor.get();
}

@Override
Expand All @@ -227,7 +227,7 @@ public void periodic() {
* update logging
*/
public void updateLogging() {
indexerPowerLog.append(indexerMotor.get());
indexerPowerLog.append(motor.get());
indexerTargetPowerLog.append(targetPower);
entryBeamBreakLog.append(getEntryBeamBreakState());
exitBeamBreakLog.append(getExitBeamBreakState());
Expand Down

0 comments on commit 66a21f6

Please sign in to comment.