Merge branch 'main' of https://demerso.net/pls5618/2023/robot
This commit is contained in:
@ -4,11 +4,26 @@
|
||||
|
||||
package frc.robot.subsystems.bras;
|
||||
|
||||
|
||||
import com.revrobotics.CANSparkMax;
|
||||
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc.robot.Constants;
|
||||
|
||||
public class BrasTelescopique extends SubsystemBase {
|
||||
/** Creates a new BrasTelescopique. */
|
||||
public BrasTelescopique() {}
|
||||
final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless);
|
||||
public void AvanceRecule(double vitesse) {
|
||||
Winch.set(vitesse);
|
||||
}
|
||||
public double distance() {
|
||||
return(Winch.getEncoder().getPosition());
|
||||
}
|
||||
public void Reset() {
|
||||
Winch.getEncoder().setPosition(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void periodic() {
|
||||
|
@ -5,11 +5,25 @@
|
||||
package frc.robot.subsystems.bras;
|
||||
|
||||
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 {
|
||||
/** Creates a new Pivot. */
|
||||
public Pivot() {}
|
||||
// moteur
|
||||
private CANSparkMax pivot = new CANSparkMax(actuateur, MotorType.kBrushless);
|
||||
|
||||
// function
|
||||
public void monteDescendre(double vitesse) {
|
||||
pivot.set (vitesse);
|
||||
}
|
||||
// encoder
|
||||
public double distance(){
|
||||
return (pivot.getEncoder().getPosition());
|
||||
}
|
||||
public void Reset(){
|
||||
pivot.getEncoder().setPosition(0);
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
|
Reference in New Issue
Block a user