s
This commit is contained in:
parent
108f73436b
commit
f86be6301c
@ -10,14 +10,12 @@ import com.revrobotics.CANSparkLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.networktables.GenericEntry;
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
import edu.wpi.first.wpilibj.DoubleSolenoid;
|
||||
import edu.wpi.first.wpilibj.PneumaticsModuleType;
|
||||
import edu.wpi.first.wpilibj.Solenoid;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
|
||||
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc.robot.Constants;
|
||||
|
||||
@ -33,14 +31,11 @@ public class Grimpeur extends SubsystemBase {
|
||||
final CANSparkMax grimpeurd = new CANSparkMax(Constants.grimpeurd,MotorType.kBrushless);
|
||||
final CANSparkMax grimpeurg = new CANSparkMax(Constants.grimpeurg,MotorType.kBrushless);
|
||||
// limit switch
|
||||
final DigitalInput limitdroite = new DigitalInput(Constants.limithaut);
|
||||
final DigitalInput limitgauche = new DigitalInput(Constants.limitbas);
|
||||
final Solenoid pistondroite= new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondroiteouvre);
|
||||
final Solenoid pistondgauche = new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondgaucheouvre);
|
||||
//fonction
|
||||
public Grimpeur() {
|
||||
layout.addBoolean("limitgrimpeurd", limitdroite::get);
|
||||
layout.addBoolean("limitgrimpeurg", limitdroite::get);
|
||||
|
||||
layout.add("grimpeurencodeurd", encoderd());
|
||||
layout.add("grimpeurencodeurg", encoderg());
|
||||
layout.add("pitchgyrogrimpeur", getpitch());
|
||||
@ -51,12 +46,6 @@ public void droit(double vitesse){
|
||||
public void gauche(double vitesse){
|
||||
grimpeurg.set(vitesse);
|
||||
}
|
||||
public boolean droite(){
|
||||
return limitdroite.get();
|
||||
}
|
||||
public boolean gauche(){
|
||||
return limitgauche.get();
|
||||
}
|
||||
public void resetencodeurd(){
|
||||
grimpeurd.getEncoder().setPosition(0);
|
||||
}
|
||||
@ -84,14 +73,5 @@ public AHRS gyroscope = new AHRS();
|
||||
public boolean piston(){
|
||||
return pistondgauche.get();
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
if(droite()) {
|
||||
resetencodeurd();
|
||||
}
|
||||
if(gauche()) {
|
||||
resetencodeurg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user