mghvhj
This commit is contained in:
		| @@ -5,6 +5,8 @@ public class Constants { | ||||
|     public static int avantgauche = 1; | ||||
|     public static int arrieredroit = 2; | ||||
|     public static int arrieregauche = 3; | ||||
|     public static int BrasTelescopique = 5; | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -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() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user