robot-2023/src/main/java/frc/robot/commands/GratteMonte.java
2023-04-11 17:21:18 -04:00

56 lines
1.3 KiB
Java

// 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;
import frc.robot.subsystems.Gratte;
public class GratteMonte extends CommandBase {
private Gratte gratte;
/** Creates a new GratteMonte. */
public GratteMonte(Gratte gratte) {
this.gratte = gratte;
// Use addRequirements() here to declare subsystem dependencies.
addRequirements(gratte);
}
// Called when the command is initially scheduled.
@Override
public void initialize() {
gratte.setenHaut(true);
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(gratte.hautd()){
gratte.Leverd(0);
}
else{
gratte.Leverd(0.5);
}
if(gratte.hautg()) {
gratte.Leverg(0);
}
else{
gratte.Leverg(0.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
gratte.Leverd(0);
gratte.Leverg(0);
}
// Returns true when the command should end.
@Override
public boolean isFinished(){
return false;
}
}