encodeurs

This commit is contained in:
Antoine PerreaultE 2025-02-24 18:18:14 -05:00
parent 93e5bb0b46
commit 87c3abcb65
2 changed files with 10 additions and 0 deletions

View File

@ -4,7 +4,9 @@
package frc.robot.subsystems; package frc.robot.subsystems;
import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkLowLevel.MotorType;
@ -13,6 +15,9 @@ public class Elevateur extends SubsystemBase {
public Elevateur() {} public Elevateur() {}
final SparkMax monte = new SparkMax(22, MotorType.kBrushless); final SparkMax monte = new SparkMax(22, MotorType.kBrushless);
final DigitalInput limit2 = new DigitalInput(1); final DigitalInput limit2 = new DigitalInput(1);
GenericEntry teb = Shuffleboard.getTab("teb")
.add("elevateur encodeur",position())
.getEntry();
public double position(){ public double position(){
return monte.getEncoder().getPosition(); return monte.getEncoder().getPosition();
} }

View File

@ -7,7 +7,9 @@ package frc.robot.subsystems;
import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkLowLevel.MotorType;
import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.SparkMax;
import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Pince extends SubsystemBase { public class Pince extends SubsystemBase {
@ -18,6 +20,9 @@ public class Pince extends SubsystemBase {
final SparkMax algue1 = new SparkMax(16, MotorType.kBrushless); final SparkMax algue1 = new SparkMax(16, MotorType.kBrushless);
final SparkMax algue2 = new SparkMax(19, MotorType.kBrushless); final SparkMax algue2 = new SparkMax(19, MotorType.kBrushless);
final DigitalInput limit6 = new DigitalInput(0); final DigitalInput limit6 = new DigitalInput(0);
GenericEntry teb = Shuffleboard.getTab("teb")
.add("pince encodeur",encodeurpivot())
.getEntry();
public void aspirecoral(double vitesse){ public void aspirecoral(double vitesse){
coral.set(vitesse); coral.set(vitesse);
} }