mghvhj
This commit is contained in:
parent
3ee0a46bfa
commit
f9c6011a3c
@ -5,6 +5,8 @@ public class Constants {
|
|||||||
public static int avantgauche = 1;
|
public static int avantgauche = 1;
|
||||||
public static int arrieredroit = 2;
|
public static int arrieredroit = 2;
|
||||||
public static int arrieregauche = 3;
|
public static int arrieregauche = 3;
|
||||||
|
public static int BrasTelescopique = 5;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,11 +4,26 @@
|
|||||||
|
|
||||||
package frc.robot.subsystems.bras;
|
package frc.robot.subsystems.bras;
|
||||||
|
|
||||||
|
|
||||||
|
import com.revrobotics.CANSparkMax;
|
||||||
|
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
|
import frc.robot.Constants;
|
||||||
|
|
||||||
public class BrasTelescopique extends SubsystemBase {
|
public class BrasTelescopique extends SubsystemBase {
|
||||||
/** Creates a new BrasTelescopique. */
|
/** Creates a new BrasTelescopique. */
|
||||||
public 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
|
@Override
|
||||||
public void periodic() {
|
public void periodic() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user