32 lines
910 B
Java
Raw Normal View History

2023-02-06 19:02:17 -05:00
// 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.
2023-02-06 19:13:18 -05:00
package frc.robot.subsystems.bras;
2023-02-06 19:02:17 -05:00
import edu.wpi.first.wpilibj2.command.SubsystemBase;
2023-02-08 18:53:26 -05:00
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import static frc.robot.Constants.*;
2023-02-06 19:02:17 -05:00
public class Pivot extends SubsystemBase {
2023-02-08 18:53:26 -05:00
// moteur
private CANSparkMax pivot = new CANSparkMax(actuateur, MotorType.kBrushless);
2023-02-06 19:02:17 -05:00
2023-02-08 18:53:26 -05:00
// function
public void monteDescendredroit(double vitesse) {
pivot.set (vitesse);
}
// encoder
public double distance(){
return (pivot.getEncoder().getPosition());
}
public void Reset(){
pivot.getEncoder().setPosition(0);
}
2023-02-06 19:02:17 -05:00
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}