Antoine PerreaultE a54ebb16e9 id
2025-02-03 18:39:16 -05:00

36 lines
1017 B
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;
import com.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkLowLevel.MotorType;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Grimpeur extends SubsystemBase {
/** Creates a new Grimpeur. */
public Grimpeur() {}
final SparkMax grimpeur = new SparkMax(10,MotorType.kBrushless);
final DigitalInput limit1 = new DigitalInput(3);
public void grimpe(double vitesse){
grimpeur.set(vitesse);
}
public boolean stop(){
return limit1.get();
}
public double encodeur(){
return grimpeur.getEncoder().getPosition();
}
public void reset(){
grimpeur.getEncoder().setPosition(0);
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}