changer spark a talon accumulateur
This commit is contained in:
parent
d36e048781
commit
84d23df96f
@ -4,14 +4,15 @@
|
||||
|
||||
package frc.robot.subsystems;
|
||||
|
||||
import com.revrobotics.CANSparkMax;
|
||||
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.wpilibj.Encoder;
|
||||
import edu.wpi.first.wpilibj.motorcontrol.Talon;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc.robot.Constants;
|
||||
|
||||
public class Accumulateur extends SubsystemBase {
|
||||
private CANSparkMax moteuracc = new CANSparkMax(Constants.accumulateur, MotorType.kBrushless);
|
||||
private Talon moteuracc = new Talon(Constants.accumulateur);
|
||||
|
||||
/** Creates a new Accumulateur. */
|
||||
public Accumulateur() {
|
||||
|
||||
@ -19,12 +20,12 @@ public class Accumulateur extends SubsystemBase {
|
||||
public void Deaccumuler(double vitesse){
|
||||
moteuracc.set(vitesse);
|
||||
}
|
||||
public double distance() {
|
||||
return(moteuracc.getEncoder().getPosition());
|
||||
}
|
||||
public void Reset() {
|
||||
moteuracc.getEncoder().setPosition(0);
|
||||
}
|
||||
//public double distance() {
|
||||
// return(moteuracc.getEncoder().getPosition());
|
||||
// }
|
||||
//public void Reset() {
|
||||
// moteuracc.getEncoder().setPosition(0);
|
||||
// }
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
|
Loading…
x
Reference in New Issue
Block a user