zdxfgvcbnm,

This commit is contained in:
Antoine PerreaultE 2023-02-08 18:53:26 -05:00
parent 7c927477d1
commit 6d7ee56942

View File

@ -5,11 +5,25 @@
package frc.robot.subsystems.bras; package frc.robot.subsystems.bras;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import static frc.robot.Constants.*;
public class Pivot extends SubsystemBase { public class Pivot extends SubsystemBase {
/** Creates a new Pivot. */ // moteur
public Pivot() {} private CANSparkMax pivot = new CANSparkMax(actuateur, MotorType.kBrushless);
// function
public void monteDescendredroit(double vitesse) {
pivot.set (vitesse);
}
// encoder
public double distance(){
return (pivot.getEncoder().getPosition());
}
public void Reset(){
pivot.getEncoder().setPosition(0);
}
@Override @Override
public void periodic() { public void periodic() {
// This method will be called once per scheduler run // This method will be called once per scheduler run