42 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
// Copyright (c) FIRST and other WPILib contributors.
 | 
						|
// Open Source Software; you can modify and/or share it under the terms of
 | 
						|
// the WPILib BSD license file in the root directory of this project.
 | 
						|
 | 
						|
package frc.robot.subsystems.bras;
 | 
						|
 | 
						|
 | 
						|
import com.revrobotics.CANSparkMax;
 | 
						|
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
 | 
						|
 | 
						|
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
 | 
						|
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
 | 
						|
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
 | 
						|
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
 | 
						|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
 | 
						|
import frc.robot.Constants;
 | 
						|
 | 
						|
public class BrasTelescopique extends SubsystemBase {
 | 
						|
  
 | 
						|
ShuffleboardTab teb = Shuffleboard.getTab("teb"); 
 | 
						|
ShuffleboardLayout layout = Shuffleboard.getTab("teb")
 | 
						|
.getLayout("yeet", BuiltInLayouts.kList)
 | 
						|
.withSize(2, 2);
 | 
						|
  /** 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() {
 | 
						|
    yeet.add ("encodeur",0.1);
 | 
						|
  }
 | 
						|
}
 |