From 6d7ee56942736f1410c90b58a0184b0634656738 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 8 Feb 2023 18:53:26 -0500 Subject: [PATCH] zdxfgvcbnm, --- .../java/frc/robot/subsystems/bras/Pivot.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/bras/Pivot.java b/src/main/java/frc/robot/subsystems/bras/Pivot.java index 2742df8..ec2f376 100644 --- a/src/main/java/frc/robot/subsystems/bras/Pivot.java +++ b/src/main/java/frc/robot/subsystems/bras/Pivot.java @@ -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 monteDescendredroit(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