Skip to content

Commit

Permalink
Added master and slave motor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth-Choothakan committed Mar 2, 2024
1 parent cbd88d6 commit 26f86ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/carlmontrobotics/subsystems/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class Arm extends SubsystemBase {
// a boolean meant to tell if the arm is in a forbidden posistion AKA FORBIDDEN FLAG
private static boolean forbFlag;
private final CANSparkMax armMotor1 = MotorControllerFactory.createSparkMax(ARM_MOTOR_PORT_1, MotorConfig.NEO);
private final CANSparkMax armMotor2 = MotorControllerFactory.createSparkMax(ARM_MOTOR_PORT_2, MotorConfig.NEO)
private final CANSparkMax armMotor2 = MotorControllerFactory.createSparkMax(ARM_MOTOR_PORT_2, MotorConfig.NEO);
private final RelativeEncoder armEncoder = armMotor1.getEncoder();


Expand All @@ -56,6 +56,8 @@ public Arm() {
armEncoder.setPositionConversionFactor(rotationToRad);
armEncoder.setVelocityConversionFactor(rotationToRad);
armEncoder.setInverted(encoderInverted);

armMotor2.follow(armMotor1);

//armEncoder1.setZeroOffset(offsetRad);

Expand Down

0 comments on commit 26f86ef

Please sign in to comment.