piston
This commit is contained in:
		| @@ -11,6 +11,7 @@ import com.revrobotics.CANSparkLowLevel.MotorType; | ||||
| 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.DoubleSolenoid.Value; | ||||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||||
| import frc.robot.Constants; | ||||
| @@ -24,8 +25,8 @@ public class Grimpeur extends SubsystemBase { | ||||
|   // limit switch | ||||
|   final DigitalInput limitdroite = new DigitalInput(Constants.limithaut); | ||||
|   final DigitalInput limitgauche = new DigitalInput(Constants.limitbas); | ||||
|   final DoubleSolenoid pistondroite= new DoubleSolenoid(PneumaticsModuleType.CTREPCM, Constants.pistondroiteouvre, Constants.pistondroiteouvre); | ||||
|   final DoubleSolenoid pistondgauche= new DoubleSolenoid(PneumaticsModuleType.CTREPCM, Constants.pistondgaucheouvre, Constants.pistondroiteouvre); | ||||
|   final Solenoid pistondroite= new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondroiteouvre); | ||||
|   final Solenoid pistondgauche = new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondgaucheouvre); | ||||
|   //fonction | ||||
| public void droit(double vitesse){ | ||||
|   grimpeurd.set(vitesse); | ||||
| @@ -56,12 +57,12 @@ public AHRS gyroscope = new AHRS(); | ||||
|     return gyroscope.getPitch(); | ||||
|   } | ||||
|   public void pistonouvre(){ | ||||
|     pistondroite.set(Value.kForward); | ||||
|     pistondgauche.set(Value.kForward); | ||||
|     pistondroite.get(); | ||||
|     pistondgauche.get(); | ||||
|   } | ||||
|   public void pistonferme(){ | ||||
|     pistondroite.set(Value.kReverse); | ||||
|     pistondgauche.set(Value.kReverse); | ||||
|     pistondroite.get(); | ||||
|     pistondgauche.get(); | ||||
|   } | ||||
|   @Override | ||||
|   public void periodic() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user