generated from Patribots4738/Swerve-Command-Based
-
-
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.
(this will finish adding all changes currently on origin for all subsystem branches
- Loading branch information
1 parent
da30c84
commit 3dfb911
Showing
4 changed files
with
35 additions
and
125 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,40 +1,29 @@ | ||
package frc.robot.subsystems.shooter; | ||
package frc.robot.subsystems.Shooter; | ||
|
||
import com.revrobotics.CANSparkLowLevel.PeriodicFrame; | ||
public class Pivot { | ||
pivot = new Neo(ShooterConstants.SHOOTER_PIVOT_CAN_ID); | ||
configMotor(); | ||
} | ||
|
||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import frc.robot.util.Neo; | ||
import frc.robot.util.Constants.ShooterConstants; | ||
|
||
public class Pivot extends SubsystemBase { | ||
private Neo pivot; | ||
|
||
public Pivot() { | ||
this.pivot = new Neo(ShooterConstants.SHOOTER_PIVOT_CAN_ID); | ||
|
||
configMotor(); | ||
} | ||
|
||
|
||
public void configMotor() { | ||
pivot.setSmartCurrentLimit(ShooterConstants.PIVOT_CURRENT_LIMIT); | ||
public void configMotor() { | ||
pivot.setSmartCurrentLimit(PivotConstants.PIVOT_CURRENT_LIMIT); | ||
// See https://docs.revrobotics.com/sparkmax/operating-modes/control-interfaces | ||
pivot.setPeriodicFramePeriod(PeriodicFrame.kStatus3, 65535); | ||
pivot.setPeriodicFramePeriod(PeriodicFrame.kStatus5, 65535); | ||
pivot.setInverted(false); | ||
|
||
pivot.setPID( | ||
ShooterConstants.PIVOT_P, | ||
ShooterConstants.PIVOT_I, | ||
ShooterConstants.PIVOT_D, | ||
ShooterConstants.PIVOT_MIN_OUTPUT, | ||
ShooterConstants.PIVOT_MAX_OUTPUT); | ||
Pivot.setPID( | ||
ShooterConstants.SHOOTER_P, | ||
ShooterConstants.SHOOTER_I, | ||
ShooterConstants.SHOOTER_D, | ||
ShooterConstants.SHOOTER_MIN_OUTPUT, | ||
ShooterConstants.SHOOTER_MAX_OUTPUT); | ||
|
||
|
||
//sets brake mode | ||
pivot.setBrakeMode(); | ||
} | ||
|
||
public void setAngle(double angle) { | ||
pivot.setTargetPosition(angle); | ||
} | ||
public void setAngle(double angle) { | ||
pivot.setTargetPosition(angle); | ||
} |
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