45 lines
1.3 KiB
Java
45 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.subsystem;
|
|
|
|
import com.revrobotics.CANSparkMax;
|
|
import com.revrobotics.CANSparkLowLevel.MotorType;
|
|
|
|
|
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|
import frc.robot.Constants;
|
|
|
|
public class Lanceur extends SubsystemBase {
|
|
/** Creates a new Lanceur. */
|
|
|
|
|
|
public Lanceur() {}
|
|
final CANSparkMax lanceur1 = new CANSparkMax(Constants.lanceur, MotorType.kBrushless);
|
|
final CANSparkMax lanceur2 = new CANSparkMax(Constants.lancer2, MotorType.kBrushless);
|
|
final CANSparkMax lanceur3 = new CANSparkMax(Constants.lancer3, MotorType.kBrushless);
|
|
final CANSparkMax lanceur4 = new CANSparkMax(Constants.lancer4, MotorType.kBrushless);
|
|
public void pid(){
|
|
lanceur1.getPIDController();
|
|
}
|
|
public void lancer(double vitesse){
|
|
lanceur1.set(vitesse);
|
|
}
|
|
public double vitesse(double vitesse){
|
|
return lanceur1.getEncoder().getVelocity();
|
|
}
|
|
public void lanceur(){
|
|
lanceur2.follow(lanceur1);
|
|
lanceur3.follow(lanceur1);
|
|
lanceur4.follow(lanceur1);
|
|
lanceur3.setInverted(true);
|
|
lanceur4.setInverted(true);
|
|
}
|
|
|
|
@Override
|
|
public void periodic() {}
|
|
// This method will be called once per scheduler run
|
|
|
|
}
|