Skip to content

Commit

Permalink
feat: added tramp IOs.
Browse files Browse the repository at this point in the history
  • Loading branch information
NateLydem committed Jan 26, 2024
1 parent e11715f commit 98f603d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/org/team1540/robot2024/subsystems/tramp/Tramp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.team1540.robot2024.subsystems.tramp;

import edu.wpi.first.wpilibj2.command.SubsystemBase;

public class Tramp extends SubsystemBase {
private final TrampIO io;
private final TrampIOInputsAutoLogged inputs = new TrampIOInputsAutoLogged();

@Override
public void periodic() {
io.updateInputs(inputs);
}

public Tramp(TrampIO io) {
this.io = io;

}
}
15 changes: 15 additions & 0 deletions src/main/java/org/team1540/robot2024/subsystems/tramp/TrampIO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.team1540.robot2024.subsystems.tramp;

import org.littletonrobotics.junction.AutoLog;


public interface TrampIO {
@AutoLog
class TrampIOInputs {
boolean beamBreak = false;
double motorVelocity;
}

default void updateInputs(TrampIOInputs inputs) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.team1540.robot2024.subsystems.tramp;

import edu.wpi.first.wpilibj.DigitalInput;

public class TrampIOReal implements TrampIO {
DigitalInput beamBreak = new DigitalInput(0);
public void updateInputs(TrampIOInputs inputs) {
inputs.beamBreak = beamBreak.get();
}
}

0 comments on commit 98f603d

Please sign in to comment.