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