Module fini
This commit is contained in:
40
src/main/java/frc/robot/subsystems/Balayeuse.java
Normal file
40
src/main/java/frc/robot/subsystems/Balayeuse.java
Normal file
@@ -0,0 +1,40 @@
|
||||
// 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.SparkFlex;
|
||||
import com.revrobotics.spark.SparkMax;
|
||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
|
||||
public class Balayeuse extends SubsystemBase {
|
||||
SparkFlex Balaye = new SparkFlex(5, MotorType.kBrushless);
|
||||
SparkMax Pivot = new SparkMax(6, MotorType.kBrushless);
|
||||
DigitalInput limit = new DigitalInput(0);
|
||||
public void Balayer(double vitesse){
|
||||
Balaye.set(vitesse);
|
||||
}
|
||||
public void Pivoter(double vitesse){
|
||||
Pivot.set(vitesse);
|
||||
}
|
||||
public double Distance(){
|
||||
return Pivot.getEncoder().getPosition();
|
||||
}
|
||||
public void Reset(){
|
||||
Pivot.getEncoder().setPosition(0);
|
||||
}
|
||||
public boolean GetLimiSwtich(){
|
||||
return limit.get();
|
||||
}
|
||||
/** Creates a new Balayeuse. */
|
||||
public Balayeuse() {}
|
||||
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user