40 lines
1.2 KiB
Java
40 lines
1.2 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;
|
|
|
|
import com.revrobotics.spark.SparkMax;
|
|
import com.revrobotics.spark.config.SparkMaxConfig;
|
|
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
|
import edu.wpi.first.wpilibj.DigitalInput;
|
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|
|
|
public class Grimpeur extends SubsystemBase {
|
|
SparkMax grimpeur1 = new SparkMax(8,MotorType.kBrushless);
|
|
SparkMax grimpeur2 = new SparkMax(9,MotorType.kBrushless);
|
|
SparkMaxConfig slaveConfig = new SparkMaxConfig();
|
|
DigitalInput limit = new DigitalInput(1);
|
|
public void Grimper(double vitesse){
|
|
grimpeur1.set(vitesse);
|
|
grimpeur2.set(vitesse);
|
|
|
|
}
|
|
public double Position(){
|
|
return grimpeur1.getEncoder().getPosition();
|
|
}
|
|
public void Reset(){
|
|
grimpeur1.getEncoder().setPosition(0);
|
|
}
|
|
public boolean Limit(){
|
|
return limit.get();
|
|
}
|
|
/** Creates a new Grimpeur. */
|
|
public Grimpeur() {}
|
|
|
|
@Override
|
|
public void periodic() {
|
|
// This method will be called once per scheduler run
|
|
}
|
|
}
|