- encodeurs

This commit is contained in:
Olivier Dubois 2024-10-28 18:49:53 -04:00
parent eca7bb1891
commit 4944f4662b
2 changed files with 1 additions and 6 deletions

View File

@ -19,7 +19,7 @@ public class Desaccumuler extends Command {
// Called when the command is initially scheduled. // Called when the command is initially scheduled.
@Override @Override
public void initialize() { public void initialize() {
accumulateur.resetencodeur();
} }
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.

View File

@ -4,7 +4,6 @@
package frc.robot.Subsystems; package frc.robot.Subsystems;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
public class Accumulateur extends SubsystemBase { public class Accumulateur extends SubsystemBase {
@ -13,10 +12,6 @@ public class Accumulateur extends SubsystemBase {
public Accumulateur() {} public Accumulateur() {}
final WPI_TalonSRX accumulateur1 = new WPI_TalonSRX(0); final WPI_TalonSRX accumulateur1 = new WPI_TalonSRX(0);
final WPI_TalonSRX accumulateur2 = new WPI_TalonSRX(10); final WPI_TalonSRX accumulateur2 = new WPI_TalonSRX(10);
Encoder encoder = new Encoder(1,0);
public void resetencodeur(){
encoder.reset();
}
public void desaccumule(double vitesse){ public void desaccumule(double vitesse){
accumulateur1.set(vitesse); accumulateur1.set(vitesse);
accumulateur2.set(-vitesse); accumulateur2.set(-vitesse);