Skip to content

Commit

Permalink
better solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Anhysteretic committed Sep 22, 2024
1 parent 6d458c7 commit 0c99ec8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/team841/calliope/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public RobotContainer() {
this.hanger = new Hanger(this.hangerIO);

this.ledIO = new LEDIOSpark();
this.led = new LED(this.ledIO);
this.led = new LED(this.ledIO, this.indexer, this.intake);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@ public class LED extends SubsystemBase {
private int count = 0;

/** Creates a new LED. */
public LED(LEDIO io) {
public LED(LEDIO io, Indexer indexer, Intake intake) {
this.io = io;
this.indexer = indexer;
this.intake = intake;
}

@Override
public void periodic() {
io.updateInputs(inputs);
Logger.processInputs("LED", inputs);

if (this.indexer == null)
this.indexer = Robot.m_robotContainer.indexer;
if (this.intake == null)
this.intake = Robot.m_robotContainer.intake;

// if (intake.)
if (indexer.getRightIndexerSensor() && indexer.getLeftIndexerSensor()) {
io.setColor("Green");
if (count == 0) count += 1;
Expand Down

0 comments on commit 0c99ec8

Please sign in to comment.