diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 4a5c923..c6ffe06 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -5,6 +5,7 @@ public class Constants { public static int avantgauche = 1; public static int arrieredroit = 2; public static int arrieregauche = 3; +<<<<<<< HEAD public static int BrasTelescopique = 5; @@ -12,4 +13,7 @@ public class Constants { +======= + public static int actuateur = 4; +>>>>>>> 91d5a71d52bad9fc56b40c68d78207113e16cd21 } diff --git a/src/main/java/frc/robot/commands/Drive.java b/src/main/java/frc/robot/commands/Drive.java deleted file mode 100644 index 4288b6a..0000000 --- a/src/main/java/frc/robot/commands/Drive.java +++ /dev/null @@ -1,32 +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.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; - -public class Drive extends CommandBase { - /** Creates a new Drive. */ - public Drive() { - // Use addRequirements() here to declare subsystem dependencies. - } - - // Called when the command is initially scheduled. - @Override - public void initialize() {} - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() {} - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) {} - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/src/main/java/frc/robot/subsystems/Gratte.java b/src/main/java/frc/robot/subsystems/Gratte.java new file mode 100644 index 0000000..5baa6b8 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/Gratte.java @@ -0,0 +1,17 @@ +// 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; + +public class Gratte extends SubsystemBase { + /** Creates a new Gratte. */ + public Gratte() {} + + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} diff --git a/src/main/java/frc/robot/subsystems/bras/Pivot.java b/src/main/java/frc/robot/subsystems/bras/Pivot.java index 2742df8..e8d5dbb 100644 --- a/src/main/java/frc/robot/subsystems/bras/Pivot.java +++ b/src/main/java/frc/robot/subsystems/bras/Pivot.java @@ -5,11 +5,25 @@ package frc.robot.subsystems.bras; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import com.revrobotics.CANSparkMax; +import com.revrobotics.CANSparkMaxLowLevel.MotorType; +import static frc.robot.Constants.*; public class Pivot extends SubsystemBase { - /** Creates a new Pivot. */ - public Pivot() {} + // moteur + private CANSparkMax pivot = new CANSparkMax(actuateur, MotorType.kBrushless); + // function + public void monteDescendre(double vitesse) { + pivot.set (vitesse); + } + // encoder + public double distance(){ + return (pivot.getEncoder().getPosition()); + } + public void Reset(){ + pivot.getEncoder().setPosition(0); + } @Override public void periodic() { // This method will be called once per scheduler run