zdxfgvcbnm,
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user