2023-02-06 19:02:17 -05:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
|
2023-02-06 19:13:18 -05:00
|
|
|
package frc.robot.subsystems.bras;
|
2023-02-06 19:02:17 -05:00
|
|
|
|
|
|
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
2023-02-08 18:53:26 -05:00
|
|
|
import com.revrobotics.CANSparkMax;
|
|
|
|
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
|
|
|
import static frc.robot.Constants.*;
|
2023-02-06 19:02:17 -05:00
|
|
|
|
|
|
|
public class Pivot extends SubsystemBase {
|
2023-02-08 18:53:26 -05:00
|
|
|
// moteur
|
|
|
|
private CANSparkMax pivot = new CANSparkMax(actuateur, MotorType.kBrushless);
|
2023-02-06 19:02:17 -05:00
|
|
|
|
2023-02-08 18:53:26 -05:00
|
|
|
// function
|
2023-02-08 18:59:45 -05:00
|
|
|
public void monteDescendre(double vitesse) {
|
2023-02-08 18:53:26 -05:00
|
|
|
pivot.set (vitesse);
|
|
|
|
}
|
|
|
|
// encoder
|
|
|
|
public double distance(){
|
|
|
|
return (pivot.getEncoder().getPosition());
|
|
|
|
}
|
|
|
|
public void Reset(){
|
|
|
|
pivot.getEncoder().setPosition(0);
|
|
|
|
}
|
2023-02-06 19:02:17 -05:00
|
|
|
@Override
|
|
|
|
public void periodic() {
|
|
|
|
// This method will be called once per scheduler run
|
|
|
|
}
|
|
|
|
}
|