aspire
This commit is contained in:
parent
edbff8f4dd
commit
5ffa28596c
44
src/main/java/frc/robot/subsystems/Pince.java
Normal file
44
src/main/java/frc/robot/subsystems/Pince.java
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
// 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 void pisotion(){
|
||||||
|
limit6.get();
|
||||||
|
}
|
||||||
|
public void reset(){
|
||||||
|
pivoti.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