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.
Merge remote-tracking branch 'origin/pivot-subsystem' into 27-handoff…
…-command
- Loading branch information
Showing
3 changed files
with
32 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package frc.robot.subsystems.Shooter; | ||
|
||
public class Pivot { | ||
pivot = new Neo(ShooterConstants.SHOOTER_PIVOT_CAN_ID); | ||
configMotor(); | ||
} | ||
|
||
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.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); | ||
} |
File renamed without changes.
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