-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
5b58b58
commit 6834ac1
Showing
11 changed files
with
147 additions
and
38 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
17 changes: 17 additions & 0 deletions
17
src/main/java/frc/robot/subsystems/Shooter/LeafBlowerIO.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,17 @@ | ||
package frc.robot.subsystems.shooter; | ||
|
||
import org.littletonrobotics.junction.AutoLog; | ||
|
||
public interface LeafBlowerIO { | ||
@AutoLog | ||
static class LeafBlowerIOInputs { | ||
public double appliedVolts = 0.0; | ||
public double currentAmps = 0.0; | ||
} | ||
|
||
public default void updateInputs(LeafBlowerIOInputs inputs) {} | ||
|
||
public default void setSpeed(double percentSpeed) {} | ||
|
||
public default void stop() {} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/frc/robot/subsystems/Shooter/LeafBlowerIOTalonSRX.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,33 @@ | ||
package frc.robot.subsystems.shooter; | ||
|
||
import com.ctre.phoenix.motorcontrol.ControlMode; | ||
import com.ctre.phoenix.motorcontrol.can.TalonSRX; | ||
|
||
public class LeafBlowerIOTalonSRX implements LeafBlowerIO { | ||
|
||
private final TalonSRX leafBlower; | ||
|
||
// private final double currentAmps; | ||
// private final double appliedVolts; | ||
|
||
public LeafBlowerIOTalonSRX(int id) { | ||
|
||
leafBlower = new TalonSRX(id); | ||
} | ||
|
||
@Override | ||
public void updateInputs(LeafBlowerIOInputs inputs) { | ||
inputs.appliedVolts = leafBlower.getMotorOutputVoltage(); | ||
inputs.currentAmps = leafBlower.getStatorCurrent(); | ||
} | ||
|
||
@Override | ||
public void setSpeed(double percentSpeed) { | ||
leafBlower.set(ControlMode.PercentOutput, percentSpeed); | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
leafBlower.set(ControlMode.PercentOutput, 0); | ||
} | ||
} |
Oops, something went wrong.