-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/main/java/org/team1540/robot2024/subsystems/tramp/Tramp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
15
src/main/java/org/team1540/robot2024/subsystems/tramp/TrampIO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/team1540/robot2024/subsystems/tramp/TrampIOReal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |