-
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
7 changed files
with
92 additions
and
113 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
65 changes: 65 additions & 0 deletions
65
src/main/java/frc/robot/subsystems/shooterPivot/ShooterPivotIOSparks.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,65 @@ | ||
package frc.robot.subsystems.shooterPivot; | ||
|
||
import com.revrobotics.CANSparkBase.IdleMode; | ||
import com.revrobotics.CANSparkLowLevel.MotorType; | ||
import com.revrobotics.CANSparkLowLevel.PeriodicFrame; | ||
import com.revrobotics.CANSparkMax; | ||
import com.revrobotics.SparkAnalogSensor; | ||
import frc.robot.util.RedHawkUtil; | ||
import java.util.HashMap; | ||
|
||
public class ShooterPivotIOSparks implements ShooterPivotIO { | ||
|
||
CANSparkMax spark; | ||
SparkAnalogSensor analogSensor; | ||
|
||
public ShooterPivotIOSparks() { | ||
spark = new CANSparkMax(0, MotorType.kBrushless); | ||
analogSensor = spark.getAnalog(SparkAnalogSensor.Mode.kAbsolute); | ||
|
||
spark.restoreFactoryDefaults(); | ||
spark.getPIDController().setFeedbackDevice(analogSensor); | ||
|
||
spark.setSmartCurrentLimit(20); | ||
RedHawkUtil.configureCANSparkMAXStatusFrames( | ||
new HashMap<>() { | ||
{ | ||
put(PeriodicFrame.kStatus0, 60); | ||
put(PeriodicFrame.kStatus1, 40); | ||
put(PeriodicFrame.kStatus2, 40); | ||
put(PeriodicFrame.kStatus3, 65535); | ||
put(PeriodicFrame.kStatus4, 65535); | ||
put(PeriodicFrame.kStatus5, 20); | ||
put(PeriodicFrame.kStatus6, 20); | ||
} | ||
}, | ||
spark); | ||
|
||
spark.setIdleMode(IdleMode.kBrake); | ||
spark.setInverted(false); | ||
} | ||
|
||
@Override | ||
public void updateInputs(ShooterPivotInputs inputs) { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'updateInputs'"); | ||
} | ||
|
||
@Override | ||
public void reseedPosition(double angleDeg) { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'reseedPosition'"); | ||
} | ||
|
||
@Override | ||
public void setVoltage(double volts) { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'setVoltage'"); | ||
} | ||
|
||
@Override | ||
public void setTargetPosition(double angleDeg) { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'setTargetPosition'"); | ||
} | ||
} |
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