Merge branch 'main' of https://demerso.net/pls5618/2023/robot
This commit is contained in:
17
src/main/java/frc/robot/subsystems/Gratte.java
Normal file
17
src/main/java/frc/robot/subsystems/Gratte.java
Normal file
@ -0,0 +1,17 @@
|
||||
// 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 edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
|
||||
public class Gratte extends SubsystemBase {
|
||||
/** Creates a new Gratte. */
|
||||
public Gratte() {}
|
||||
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
@ -5,11 +5,25 @@
|
||||
package frc.robot.subsystems.bras;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import com.revrobotics.CANSparkMax;
|
||||
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
||||
import static frc.robot.Constants.*;
|
||||
|
||||
public class Pivot extends SubsystemBase {
|
||||
/** Creates a new Pivot. */
|
||||
public Pivot() {}
|
||||
// moteur
|
||||
private CANSparkMax pivot = new CANSparkMax(actuateur, MotorType.kBrushless);
|
||||
|
||||
// function
|
||||
public void monteDescendre(double vitesse) {
|
||||
pivot.set (vitesse);
|
||||
}
|
||||
// encoder
|
||||
public double distance(){
|
||||
return (pivot.getEncoder().getPosition());
|
||||
}
|
||||
public void Reset(){
|
||||
pivot.getEncoder().setPosition(0);
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
|
Reference in New Issue
Block a user