This commit is contained in:
2023-02-13 18:45:12 -05:00
5 changed files with 93 additions and 7 deletions

View File

@ -6,6 +6,9 @@ package frc.robot.subsystems;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
@ -16,7 +19,8 @@ public class BasePilotable extends SubsystemBase {
final CANSparkMax avantgauche = new CANSparkMax(Constants.avantgauche, MotorType.kBrushless);
final CANSparkMax arrieredroit = new CANSparkMax(Constants.arrieredroit, MotorType.kBrushless);
final CANSparkMax arrieregauche = new CANSparkMax(Constants.arrieregauche, MotorType.kBrushless);
private DoubleSolenoid brakedroit = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonpinceouvre, Constants.pistonpinceferme);
private DoubleSolenoid brakegauche = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonpinceouvre, Constants.pistonpinceferme);
final MotorControllerGroup droit = new MotorControllerGroup(avantdroit, arrieredroit);
final MotorControllerGroup gauche = new MotorControllerGroup(avantgauche, arrieregauche);

View File

@ -19,8 +19,8 @@ import frc.robot.Constants;
public class Gratte extends SubsystemBase {
private WPI_TalonSRX baisserGratte = new WPI_TalonSRX(Constants.leverGratte);
private WPI_TalonSRX leverGratte = new WPI_TalonSRX(Constants.baisserGratte);
private WPI_TalonSRX Gratted = new WPI_TalonSRX(Constants.leverGratte);
private WPI_TalonSRX Gratteg = new WPI_TalonSRX(Constants.baisserGratte);
private DigitalInput limithd = new DigitalInput(Constants.limithd);
private DigitalInput limithg = new DigitalInput(Constants.limithg);
private DigitalInput limitbd = new DigitalInput(Constants.limitbd);
@ -41,9 +41,13 @@ public class Gratte extends SubsystemBase {
}
/** Creates a new Gratte. */
public Gratte() {}
public void BaisserLever(double vitesse){
baisserGratte.set(vitesse);
leverGratte.set(vitesse);
public void Lever(double vitesse){
Gratted.set(vitesse);
Gratteg.set(vitesse);
}
public void baiser(double vitesse){
Gratted.set(-vitesse);
Gratteg.set(-vitesse);
}
@Override
public void periodic() {