2023-03-21 23:17:59 +00:00

60 lines
1.9 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 edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import frc.robot.Constants;
public class Gratte extends SubsystemBase {
ShuffleboardTab teb = Shuffleboard.getTab("teb");
ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb")
.getLayout("limitswitchsgratte", BuiltInLayouts.kList)
.withSize(2, 2);
private WPI_TalonSRX Gratted = new WPI_TalonSRX(Constants.GratteD);
private WPI_TalonSRX Gratteg = new WPI_TalonSRX(Constants.GratteG);
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();
}
public Gratte() {
limitswitchgratte.addBoolean ("limitbd", this::basd);
limitswitchgratte.addBoolean ("limithg", this::hautg);
limitswitchgratte.addBoolean ("limithd", this::hautd);
limitswitchgratte.addBoolean ("limitbg", this::basg);
}
public void bougerd(double vitesse){
Gratted.set(vitesse);
}
public void bougerg(double vitesse){
Gratteg.set(vitesse);
}
@Override
public void periodic(){
}
}