dashboard
This commit is contained in:
		| @@ -23,8 +23,8 @@ public class RobotContainer { | ||||
|   } | ||||
|  | ||||
|   private void configureBindings() { | ||||
|     manette2.b().whileTrue(new BalayeuseAlgue(requin)); | ||||
|     manette2.x().whileTrue(new BalayeuseCoral(requin)); | ||||
|     manette2.b().whileTrue(new BalayeuseAlgue(requin, bougie)); | ||||
|     manette2.x().whileTrue(new BalayeuseCoral(requin, bougie)); | ||||
|     manette2.y().whileTrue(new L1Requin(requin,bougie)); | ||||
|     manette2.rightBumper().whileTrue(new BalayeuseHaut(requin)); | ||||
|   } | ||||
|   | ||||
| @@ -13,7 +13,7 @@ public class BalayeuseAlgue extends Command { | ||||
|   private Requin requin; | ||||
|   private Bougie bougie; | ||||
|   /** Creates a new Balayeuse. */ | ||||
|   public BalayeuseAlgue(Requin requin) { | ||||
|   public BalayeuseAlgue(Requin requin, Bougie bougie) { | ||||
|     this.requin = requin; | ||||
|     this.bougie =bougie; | ||||
|     addRequirements(requin,bougie); | ||||
| @@ -27,16 +27,17 @@ public class BalayeuseAlgue extends Command { | ||||
|   // Called every time the scheduler runs while the command is scheduled. | ||||
|   @Override | ||||
|   public void execute() { | ||||
|      if(requin.encodeur()>=500 &&  requin.encodeur()<=510){ | ||||
|      if(requin.encodeur()>=500 &&  requin.encodeur()<=510) | ||||
|      { | ||||
|        requin.rotationer(0); | ||||
|        if(requin.stop()){ | ||||
|        if(requin.amp()> 60){ | ||||
|        requin.balaye(0); | ||||
|        bougie.Vert(); | ||||
|      } | ||||
|          else{ | ||||
|            | ||||
|       else | ||||
|       { | ||||
|            requin.balaye(0.5); | ||||
|      } | ||||
|       } | ||||
|      } | ||||
|      else if(requin.encodeur()>=510){ | ||||
|      requin.rotationer(0.5); | ||||
|   | ||||
| @@ -13,7 +13,7 @@ public class BalayeuseCoral extends Command { | ||||
|   private Requin requin; | ||||
|   private Bougie bougie; | ||||
|   /** Creates a new Balayeuse. */ | ||||
|   public BalayeuseCoral(Requin requin) { | ||||
|   public BalayeuseCoral(Requin requin, Bougie bougie) { | ||||
|     this.requin = requin; | ||||
|     this.bougie = bougie; | ||||
|     addRequirements(requin,bougie); | ||||
| @@ -29,7 +29,7 @@ public class BalayeuseCoral extends Command { | ||||
|   public void execute() { | ||||
|      if(requin.encodeur()>=100 &&  requin.encodeur()<=110){ | ||||
|        requin.rotationer(0); | ||||
|       if(requin.amp()>8){ | ||||
|       if(requin.amp()>60){ | ||||
|       requin.balaye(0); | ||||
|        bougie.Vert(); | ||||
|        if(requin.enHaut()){ | ||||
|   | ||||
| @@ -11,7 +11,7 @@ import com.ctre.phoenix.led.RainbowAnimation; | ||||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||||
|  | ||||
| public class Bougie extends SubsystemBase { | ||||
|   CANdle candle = new CANdle(50); | ||||
|   CANdle candle = new CANdle(23); | ||||
|   CANdleConfiguration config = new CANdleConfiguration(); | ||||
|   RainbowAnimation rainbowAnim = new RainbowAnimation(1, 0.5, 64); | ||||
|   /** Creates a new Bougie. */ | ||||
|   | ||||
| @@ -1,26 +0,0 @@ | ||||
| // 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.wpilibj.DigitalInput; | ||||
| import edu.wpi.first.wpilibj.motorcontrol.Spark; | ||||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||||
|  | ||||
| public class Grimpeur extends SubsystemBase { | ||||
|   /** Creates a new Grimpeur. */ | ||||
|   public Grimpeur() {} | ||||
|   final Spark grimpeur = new Spark(16); | ||||
|   final DigitalInput limit1 = new DigitalInput(0); | ||||
|   public void grimpe(double vitesse){ | ||||
|     grimpeur.set(vitesse); | ||||
|   } | ||||
|   final void stop(){ | ||||
|     limit1.get(); | ||||
|   } | ||||
|   @Override | ||||
|   public void periodic() { | ||||
|     // This method will be called once per scheduler run | ||||
|   } | ||||
| } | ||||
| @@ -8,7 +8,11 @@ import com.revrobotics.spark.SparkFlex; | ||||
| import com.revrobotics.spark.SparkMax; | ||||
| import com.revrobotics.spark.SparkLowLevel.MotorType; | ||||
|  | ||||
| import edu.wpi.first.networktables.GenericEntry; | ||||
| import edu.wpi.first.wpilibj.DigitalInput; | ||||
| import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; | ||||
| import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardComponent; | ||||
| import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||||
| import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||||
|  | ||||
| public class Requin extends SubsystemBase { | ||||
| @@ -17,7 +21,11 @@ public class Requin extends SubsystemBase { | ||||
|   final SparkFlex balaye = new SparkFlex(15, MotorType.kBrushless); | ||||
|   final SparkMax rotatione = new SparkMax(17, MotorType.kBrushless); | ||||
|   final DigitalInput limit3 = new DigitalInput(4); | ||||
|   final DigitalInput limit5 = new DigitalInput(5); | ||||
|  | ||||
|   GenericEntry teb = Shuffleboard.getTab("teb") | ||||
|   .add("amp",encodeur()) | ||||
|   .getEntry(); | ||||
|      | ||||
|   public void balaye(double vitesse){ | ||||
|     balaye.set(vitesse); | ||||
|   } | ||||
| @@ -27,9 +35,6 @@ public class Requin extends SubsystemBase { | ||||
|   public boolean enHaut(){ | ||||
|   return limit3.get(); | ||||
|   }  | ||||
|   public boolean stop(){ | ||||
|   return  limit5.get(); | ||||
|   } | ||||
|   public double encodeur(){ | ||||
|   return rotatione.getEncoder().getPosition(); | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user