2023-02-08 18:58:29 -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.
|
|
|
|
|
|
|
|
package frc.robot.subsystems;
|
|
|
|
|
|
|
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|
|
|
|
|
|
|
public class Gratte extends SubsystemBase {
|
|
|
|
/** Creates a new Gratte. */
|
|
|
|
public Gratte() {}
|
|
|
|
|
2023-02-08 19:55:20 -05:00
|
|
|
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
|
|
|
import com.fasterxml.jackson.annotation.JacksonInject.Value;
|
|
|
|
|
|
|
|
import edu.wpi.first.wpilibj.DigitalInput;
|
2023-02-08 19:16:36 -05:00
|
|
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
2023-02-08 19:55:20 -05:00
|
|
|
import frc.robot.Constants;
|
2023-02-08 19:16:36 -05:00
|
|
|
|
|
|
|
public class Gratte extends SubsystemBase {
|
2023-02-08 19:55:20 -05:00
|
|
|
private WPI_TalonSRX baisserGratte = new WPI_TalonSRX(Constants.leverGratte);
|
|
|
|
private WPI_TalonSRX leverGratte = 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);
|
|
|
|
private DigitalInput limitbg = new DigitalInput(Constants.limitbg);
|
|
|
|
public boolean hautd(){
|
|
|
|
return limithd.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean hautg(){
|
|
|
|
return limithg.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean basd(){
|
|
|
|
return limitbd.get();
|
|
|
|
}
|
|
|
|
public boolean basg(){
|
|
|
|
return limitbg.get();
|
|
|
|
}
|
2023-02-08 19:16:36 -05:00
|
|
|
/** Creates a new Gratte. */
|
|
|
|
public Gratte() {}
|
2023-02-08 19:55:20 -05:00
|
|
|
public void BaisserLever(double vitesse){
|
|
|
|
baisserGratte.set(vitesse);
|
|
|
|
leverGratte.set(vitesse);
|
|
|
|
}
|
2023-02-08 18:58:29 -05:00
|
|
|
@Override
|
|
|
|
public void periodic() {
|
|
|
|
// This method will be called once per scheduler run
|
|
|
|
}
|
|
|
|
}
|