Add an extender reset button to SmartDashboard

This commit is contained in:
nathanrsxtn
2022-04-07 19:48:09 -06:00
parent bcd25679e8
commit 503dcd7845
@@ -10,6 +10,7 @@ import com.revrobotics.SparkMaxLimitSwitch;
import com.revrobotics.CANSparkMax.SoftLimitDirection;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc4388.robot.Constants.ExtenderConstants;
@@ -34,6 +35,7 @@ public class Extender extends SubsystemBase {
m_extenderMotor.setSoftLimit(SoftLimitDirection.kForward, (float) ExtenderConstants.EXTENDER_FORWARD_LIMIT);
m_extenderMotor.setSoftLimit(SoftLimitDirection.kReverse, (float) ExtenderConstants.EXTENDER_REVERSE_LIMIT);
setExtenderSoftLimits(true);
SmartDashboard.putData(new InstantCommand(() -> m_extenderMotor.getEncoder().setPosition(0)));
}
/**