Skip to content

Commit

Permalink
new classes
Browse files Browse the repository at this point in the history
  • Loading branch information
therbun committed Jan 20, 2025
1 parent a82e14f commit 98277e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package frc.robot.subsystems.SingleJointedArmSubsystem;

public class SingleJointedArmEncoderIO {
public class SingleJointedArmIOEncoder {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package frc.robot.subsystems.SingleJointedArmSubsystem;

public class Module {
public class SingleJointedArmIOSparkMax {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@



import com.revrobotics.spark.SparkLowLevel;
import edu.wpi.first.epilogue.Logged;
import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.math.controller.SimpleMotorFeedforward;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.motorcontrol.PWMSparkMax;
import com.revrobotics.spark.SparkMax;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.constants.SingleJointedArmConstants;



public class SingleJointedArmSubsystem extends SubsystemBase {
private final PWMSparkMax armMotor = new PWMSparkMax(SingleJointedArmConstants.MotorNumber);
private final Encoder armEncoder = new Encoder();
public static int canID;
private final SparkMax armMotor = new SparkMax(canID, SparkLowLevel.MotorType.kBrushless);
//private final Encoder armEncoder = new Encoder();
private final SimpleMotorFeedforward armFeedForward = new SimpleMotorFeedforward(SingleJointedArmConstants.kSVolts, SingleJointedArmConstants.kVVoltsSecondsPerRotation);
private final PIDController armFeedback = new PIDController(SingleJointedArmConstants.kP, SingleJointedArmConstants.kD, SingleJointedArmConstants.kI);

public SingleJointedArmSubsystem() {
armFeedback.setTolerance(SingleJointedArmConstants.kArmToleranceRPS);
armEncoder.setDistancePerPulse(SingleJointedArmConstants.kEncoderDistancePerPulse);
//armEncoder.setDistancePerPulse(SingleJointedArmConstants.kEncoderDistancePerPulse);
setDefaultCommand(runOnce(() -> {
armMotor.disable();
}).andThen(run(() -> {
Expand Down

0 comments on commit 98277e0

Please sign in to comment.