26 Commits

Author SHA1 Message Date
63e476c64e Grimpeur, Fonctionne 2025-02-26 19:09:33 -05:00
9b86a0b975 limit avec grimpeur manuel 2025-02-26 17:23:27 -05:00
77240d255e grimpeur manuel 2025-02-26 16:58:50 -05:00
7ffeb78c35 grimpeur manuel 2025-02-26 16:57:51 -05:00
5b80c53963 grimpeur manuel 2025-02-26 16:56:38 -05:00
476df088ea grimpeur manuel 2025-02-26 16:54:56 -05:00
cfc6ba9479 grimpeur manuel 2025-02-26 16:53:12 -05:00
583413ec5f id 2025-02-22 11:44:53 -05:00
eb141ac2ba leds 2025-02-17 18:45:04 -05:00
3669e079bd command -> commands 2025-02-06 17:49:41 -05:00
0f81dd39e9 ils ont amener le deux par quatre 2025-02-03 18:52:32 -05:00
a984625e17 marche 2025-02-03 18:48:23 -05:00
a54ebb16e9 id 2025-02-03 18:39:16 -05:00
6437b9f152 id 2025-02-03 18:35:44 -05:00
7be1b69ece id 2025-02-03 18:31:31 -05:00
d44aea512d id 2025-02-03 18:27:30 -05:00
8a7f10ec64 id 2025-02-03 18:24:08 -05:00
345eb83d39 id 2025-02-03 18:23:17 -05:00
f01f327c81 id 2025-02-03 18:22:01 -05:00
0c7cfc9d4c id 2025-02-03 18:20:20 -05:00
831b9fec75 Touche grinpeur 2025-01-29 19:51:59 -05:00
982db16833 grimpeMieux 2025-01-28 19:22:43 -05:00
12b5e6954e 2025-01-28 18:31:02 -05:00
7e40328af4 il grimpe mieux 2025-01-28 17:51:17 -05:00
9653ca7205 grimpe 2025-01-27 19:12:49 -05:00
1583a95f52 il grimpe 2025-01-27 18:40:58 -05:00
14 changed files with 258 additions and 319 deletions

97
simgui-ds.json Normal file
View File

@ -0,0 +1,97 @@
{
"System Joysticks": {
"window": {
"enabled": false
}
},
"keyboardJoysticks": [
{
"axisConfig": [
{
"decKey": 65,
"incKey": 68
},
{
"decKey": 87,
"incKey": 83
},
{
"decKey": 69,
"decayRate": 0.0,
"incKey": 82,
"keyRate": 0.009999999776482582
}
],
"axisCount": 3,
"buttonCount": 4,
"buttonKeys": [
90,
88,
67,
86
],
"povConfig": [
{
"key0": 328,
"key135": 323,
"key180": 322,
"key225": 321,
"key270": 324,
"key315": 327,
"key45": 329,
"key90": 326
}
],
"povCount": 1
},
{
"axisConfig": [
{
"decKey": 74,
"incKey": 76
},
{
"decKey": 73,
"incKey": 75
}
],
"axisCount": 2,
"buttonCount": 4,
"buttonKeys": [
77,
44,
46,
47
],
"povCount": 0
},
{
"axisConfig": [
{
"decKey": 263,
"incKey": 262
},
{
"decKey": 265,
"incKey": 264
}
],
"axisCount": 2,
"buttonCount": 6,
"buttonKeys": [
260,
268,
266,
261,
269,
267
],
"povCount": 0
},
{
"axisCount": 0,
"buttonCount": 0,
"povCount": 0
}
]
}

View File

@ -4,17 +4,42 @@
package frc.robot; package frc.robot;
import edu.wpi.first.math.MathUtil;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.commands.GrimperHaut;
import frc.robot.commands.GrimpeurBas;
import frc.robot.commands.GrimpeurManuel;
import frc.robot.commands.ResetGrimpeur;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Grimpeur;
public class RobotContainer { public class RobotContainer {
CommandXboxController manette1 = new CommandXboxController(0);
CommandXboxController manette2 = new CommandXboxController(1);
Grimpeur grimpeur = new Grimpeur();
Bougie bougie = new Bougie();
GrimpeurManuel grimpeurManuel = new GrimpeurManuel(grimpeur, manette2::getLeftY);
public RobotContainer() { public RobotContainer() {
grimpeur.setDefaultCommand(new RunCommand(()->{
if(grimpeur.stop()){
grimpeur.grimpe(0);
}
else{
grimpeur.grimpe(MathUtil.applyDeadband(manette2.getLeftY(), 0.2));
}}, grimpeur));
configureBindings(); configureBindings();
} }
private void configureBindings() {} private void configureBindings() {
manette2.leftBumper().whileTrue(new GrimperHaut(grimpeur,bougie));
manette2.rightBumper().whileTrue(new GrimpeurBas(grimpeur));
manette2.a().whileTrue(new ResetGrimpeur(grimpeur));
}
public Command getAutonomousCommand() { public Command getAutonomousCommand() {
return Commands.print("No autonomous command configured"); return Commands.print("No autonomous command configured");
} }
} }

View File

@ -1,49 +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.command;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class CoralAlgueInspire extends Command {
private Pince pince;
/** Creates a new CoralAlgue. */
public CoralAlgueInspire(Pince pince) {
this.pince = pince;
addRequirements(pince);
// 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() {
pince.aspirecoral(-.5);
if(pince.emperagealgue()>8){
pince.aspirealgue(0);
}
else{
pince.aspirealgue(0.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.aspirecoral(0);
pince.aspirealgue(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -1,46 +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.command;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class CoralInspire extends Command {
private Pince pince;
/** Creates a new CoralAlgue. */
public CoralInspire(Pince pince) {
this.pince = pince;
addRequirements(pince);
// 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() {
if(pince.emperagecoral()>8){
pince.aspirecoral(0);
}
else{
pince.aspirecoral(.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.aspirecoral(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -1,49 +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.command;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class L4Pince extends Command {
private Pince pince;
/** Creates a new L2Pince. */
public L4Pince(Pince pince) {
this.pince = pince;
addRequirements(pince);
// 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() {
if(pince.encodeurpivot()>=800 && pince.encodeurpivot()<=810){
pince.pivote(0);
}
else if(pince.encodeurpivot()>=810){
pince.pivote(-0.5);
}
else{
pince.pivote(0.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.pivote(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -1,49 +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.command;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class StationPince extends Command {
private Pince pince;
/** Creates a new L2Pince. */
public StationPince(Pince pince) {
this.pince = pince;
addRequirements(pince);
// 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() {
if(pince.encodeurpivot()>=900 && pince.encodeurpivot()<=910){
pince.pivote(0);
}
else if(pince.encodeurpivot()>=910){
pince.pivote(-0.5);
}
else{
pince.pivote(0.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
pince.pivote(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

View File

@ -2,18 +2,21 @@
// Open Source Software; you can modify and/or share it under the terms of // 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. // the WPILib BSD license file in the root directory of this project.
package frc.robot.command; package frc.robot.commands;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince; import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Grimpeur;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class L2Pince extends Command { public class GrimperHaut extends Command {
private Pince pince; private Grimpeur grimpeur;
/** Creates a new L2Pince. */ private Bougie bougie;
public L2Pince(Pince pince) { /** Creates a new Grimper. */
this.pince = pince; public GrimperHaut(Grimpeur grimpeur, Bougie bougie) {
addRequirements(pince); this.grimpeur = grimpeur;
this.bougie = bougie;
addRequirements(grimpeur,bougie);
// Use addRequirements() here to declare subsystem dependencies. // Use addRequirements() here to declare subsystem dependencies.
} }
@ -24,26 +27,30 @@ public class L2Pince extends Command {
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.
@Override @Override
public void execute() { public void execute() {
if(pince.encodeurpivot()>=500 && pince.encodeurpivot()<=510){ if(grimpeur.stop()==true){
pince.pivote(0); grimpeur.grimpe(0);
} grimpeur.reset();
else if(pince.encodeurpivot()>=510){ bougie.RainBow();
pince.pivote(-0.3);
} }
else{ else{
pince.pivote(0.3); grimpeur.grimpe(0.5);
bougie.RainBowStop();
} }
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@Override @Override
public void end(boolean interrupted) { public void end(boolean interrupted) {
pince.pivote(0); grimpeur.grimpe(0);
if(grimpeur.stop()){
bougie.RainBow();
}
} }
// Returns true when the command should end. // Returns true when the command should end.
@Override @Override
public boolean isFinished() { public boolean isFinished() {
return false; return grimpeur.stop()==true;
} }
} }

View File

@ -2,18 +2,18 @@
// Open Source Software; you can modify and/or share it under the terms of // 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. // the WPILib BSD license file in the root directory of this project.
package frc.robot.command; package frc.robot.commands;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince; import frc.robot.subsystems.Grimpeur;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class DepartPince extends Command { public class GrimpeurBas extends Command {
private Pince pince; private Grimpeur grimpeur;
/** Creates a new DepartPince. */ /** Creates a new GrimpeurBas. */
public DepartPince(Pince pince) { public GrimpeurBas(Grimpeur grimpeur) {
this.pince = pince; this.grimpeur = grimpeur;
addRequirements(pince); addRequirements(grimpeur);
// Use addRequirements() here to declare subsystem dependencies. // Use addRequirements() here to declare subsystem dependencies.
} }
@ -24,19 +24,20 @@ public class DepartPince extends Command {
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.
@Override @Override
public void execute() { public void execute() {
if(pince.position()==true){ if(grimpeur.encodeur()>=-38.5 && grimpeur.encodeur()<=-39.19){
pince.pivote(0); grimpeur.grimpe(0);
pince.reset();
} }
else{ else if(grimpeur.encodeur()>=-38.5){
pince.pivote(.5); grimpeur.grimpe(-0.5);
} }
else{grimpeur.grimpe(0.5);
}
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@Override @Override
public void end(boolean interrupted) { public void end(boolean interrupted) {
pince.pivote(0); grimpeur.grimpe(0);
} }
// Returns true when the command should end. // Returns true when the command should end.

View File

@ -2,18 +2,22 @@
// Open Source Software; you can modify and/or share it under the terms of // 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. // the WPILib BSD license file in the root directory of this project.
package frc.robot.command; package frc.robot.commands;
import java.util.function.DoubleSupplier;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince; import frc.robot.subsystems.Grimpeur;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class L3Pince extends Command { public class GrimpeurManuel extends Command {
private Pince pince; private Grimpeur grimpeur;
/** Creates a new L2Pince. */ private DoubleSupplier x;
public L3Pince(Pince pince) { /** Creates a new GrimpeurManuel. */
this.pince = pince; public GrimpeurManuel(Grimpeur grimpeur,DoubleSupplier x) {
addRequirements(pince); this.grimpeur = grimpeur;
this.x = x;
addRequirements(grimpeur);
// Use addRequirements() here to declare subsystem dependencies. // Use addRequirements() here to declare subsystem dependencies.
} }
@ -24,21 +28,19 @@ public class L3Pince extends Command {
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.
@Override @Override
public void execute() { public void execute() {
if(pince.encodeurpivot()>=700 && pince.encodeurpivot()<=710){ if(grimpeur.stop()){
pince.pivote(0); grimpeur.grimpe(0);
}
else if(pince.encodeurpivot()>=710){
pince.pivote(-0.5);
} }
else{ else{
pince.pivote(0.5); grimpeur.grimpe(x.getAsDouble());
} }
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@Override @Override
public void end(boolean interrupted) { public void end(boolean interrupted) {
pince.pivote(0); grimpeur.grimpe(0);
} }
// Returns true when the command should end. // Returns true when the command should end.

View File

@ -2,18 +2,18 @@
// Open Source Software; you can modify and/or share it under the terms of // 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. // the WPILib BSD license file in the root directory of this project.
package frc.robot.command; package frc.robot.commands;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince; import frc.robot.subsystems.Bougie;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class CoralExpire extends Command { public class RainBow extends Command {
private Pince pince; /** Creates a new RainBow. */
/** Creates a new CoralAlgue. */ private Bougie bougie;
public CoralExpire(Pince pince) { public RainBow(Bougie bougie) {
this.pince = pince; this.bougie = bougie;
addRequirements(pince); addRequirements(bougie);
// Use addRequirements() here to declare subsystem dependencies. // Use addRequirements() here to declare subsystem dependencies.
} }
@ -24,13 +24,13 @@ public class CoralExpire extends Command {
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.
@Override @Override
public void execute() { public void execute() {
pince.aspirecoral(.5); bougie.RainBow();
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@Override @Override
public void end(boolean interrupted) { public void end(boolean interrupted) {
pince.aspirecoral(0); bougie.RainBowStop();
} }
// Returns true when the command should end. // Returns true when the command should end.

View File

@ -2,18 +2,18 @@
// Open Source Software; you can modify and/or share it under the terms of // 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. // the WPILib BSD license file in the root directory of this project.
package frc.robot.command; package frc.robot.commands;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince; import frc.robot.subsystems.Grimpeur;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class AlgueExpire extends Command { public class ResetGrimpeur extends Command {
private Pince pince; private Grimpeur grimpeur;
/** Creates a new CoralAlgue. */ /** Creates a new ResetGrimpeur. */
public AlgueExpire(Pince pince) { public ResetGrimpeur(Grimpeur grimpeur) {
this.pince = pince; this.grimpeur = grimpeur;
addRequirements(pince); addRequirements(grimpeur);
// Use addRequirements() here to declare subsystem dependencies. // Use addRequirements() here to declare subsystem dependencies.
} }
@ -24,14 +24,12 @@ public class AlgueExpire extends Command {
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.
@Override @Override
public void execute() { public void execute() {
pince.aspirealgue(0.5); grimpeur.reset();
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@Override @Override
public void end(boolean interrupted) { public void end(boolean interrupted) {}
pince.aspirealgue(0);
}
// Returns true when the command should end. // Returns true when the command should end.
@Override @Override

View File

@ -0,0 +1,38 @@
// 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 com.ctre.phoenix.led.CANdle;
import com.ctre.phoenix.led.CANdleConfiguration;
import com.ctre.phoenix.led.RainbowAnimation;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Bougie extends SubsystemBase {
CANdle candle = new CANdle(5);
CANdleConfiguration config = new CANdleConfiguration();
RainbowAnimation rainbowAnim = new RainbowAnimation(1, 0.5, 64);
/** Creates a new Bougie. */
public Bougie() {
config.brightnessScalar = 0.5;
candle.configAllSettings(config);
}
public void Rouge() {
candle.setLEDs(255, 0, 0);
}
public void Vert() {
candle.setLEDs(0, 255, 0);
}
public void Bleu() {
candle.setLEDs(0, 0, 255);
}
public void RainBow(){candle.animate(rainbowAnim);}
public void RainBowStop(){candle.animate(null);}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -4,21 +4,35 @@
package frc.robot.subsystems; package frc.robot.subsystems;
import com.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkLowLevel.MotorType;
import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.motorcontrol.Spark; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Grimpeur extends SubsystemBase { public class Grimpeur extends SubsystemBase {
/** Creates a new Grimpeur. */ /** Creates a new Grimpeur. */
public Grimpeur() {} ShuffleboardTab teb = Shuffleboard.getTab("teb");
final Spark grimpeur = new Spark(0); public Grimpeur() {
final DigitalInput limit1 = new DigitalInput(0); teb.addBoolean("limit grimpeur", this::stop);
teb.addDouble("encodeur grimpeur", this::encodeur);
}
final SparkMax grimpeur = new SparkMax(21,MotorType.kBrushless);
final DigitalInput limit1 = new DigitalInput(2);
public void grimpe(double vitesse){ public void grimpe(double vitesse){
grimpeur.set(vitesse); grimpeur.set(vitesse);
} }
final void stop(){ public boolean stop(){
limit1.get(); return limit1.get();
} }
public double encodeur(){
return grimpeur.getEncoder().getPosition();
}
public void reset(){
grimpeur.getEncoder().setPosition(0);
}
@Override @Override
public void periodic() { public void periodic() {
// This method will be called once per scheduler run // This method will be called once per scheduler run

View File

@ -1,50 +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 com.revrobotics.spark.SparkLowLevel.MotorType;
import com.revrobotics.spark.SparkMax;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Pince extends SubsystemBase {
/** Creates a new Pince. */
public Pince() {}
final SparkMax coral = new SparkMax(0, MotorType.kBrushless);
final SparkMax pivoti = new SparkMax(0, MotorType.kBrushless);
final SparkMax algue1 = new SparkMax(0, MotorType.kBrushless);
final SparkMax algue2 = new SparkMax(0, MotorType.kBrushless);
final DigitalInput limit6 = new DigitalInput(0);
public void aspirecoral(double vitesse){
coral.set(vitesse);
}
public void pivote(double vitesse){
pivoti.set(vitesse);
}
public void aspirealgue(double vitesse){
algue2.set(vitesse);
algue1.set(-vitesse);
}
public double encodeurpivot(){
return pivoti.getEncoder().getPosition();
}
public boolean position(){
return limit6.get();
}
public void reset(){
pivoti.getEncoder().setPosition(0);
}
public double emperagecoral(){
return coral.getOutputCurrent();
}
public double emperagealgue(){
return algue1.getOutputCurrent();
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}