Merge branch 'main' of https://demerso.net/pls5618/2023/robot
This commit is contained in:
commit
a6d29dff41
@ -5,6 +5,7 @@ public class Constants {
|
|||||||
public static int avantgauche = 1;
|
public static int avantgauche = 1;
|
||||||
public static int arrieredroit = 2;
|
public static int arrieredroit = 2;
|
||||||
public static int arrieregauche = 3;
|
public static int arrieregauche = 3;
|
||||||
|
<<<<<<< HEAD
|
||||||
public static int BrasTelescopique = 5;
|
public static int BrasTelescopique = 5;
|
||||||
|
|
||||||
|
|
||||||
@ -12,4 +13,7 @@ public class Constants {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=======
|
||||||
|
public static int actuateur = 4;
|
||||||
|
>>>>>>> 91d5a71d52bad9fc56b40c68d78207113e16cd21
|
||||||
}
|
}
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
// 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.commands;
|
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.CommandBase;
|
|
||||||
|
|
||||||
public class Drive extends CommandBase {
|
|
||||||
/** Creates a new Drive. */
|
|
||||||
public Drive() {
|
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the command is initially scheduled.
|
|
||||||
@Override
|
|
||||||
public void initialize() {}
|
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
|
||||||
@Override
|
|
||||||
public void execute() {}
|
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
|
||||||
@Override
|
|
||||||
public void end(boolean interrupted) {}
|
|
||||||
|
|
||||||
// Returns true when the command should end.
|
|
||||||
@Override
|
|
||||||
public boolean isFinished() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
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;
|
package frc.robot.subsystems.bras;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
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 {
|
public class Pivot extends SubsystemBase {
|
||||||
/** Creates a new Pivot. */
|
// moteur
|
||||||
public Pivot() {}
|
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
|
@Override
|
||||||
public void periodic() {
|
public void periodic() {
|
||||||
// This method will be called once per scheduler run
|
// This method will be called once per scheduler run
|
||||||
|
Loading…
x
Reference in New Issue
Block a user