48 lines
1.4 KiB
Java
48 lines
1.4 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 edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
|
import edu.wpi.first.wpilibj.DigitalInput;
|
|
import frc.robot.Constants;
|
|
|
|
public class Gratte extends SubsystemBase {
|
|
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);
|
|
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();
|
|
}
|
|
/** Creates a new Gratte. */
|
|
public Gratte() {}
|
|
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() {
|
|
// This method will be called once per scheduler run
|
|
}
|
|
}
|