package frc.robot.subsystems;

import java.util.function.DoubleSupplier;

import edu.wpi.first.wpilibj.motorcontrol.VictorSP;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.constants.ElevatorConstants;

public class Elevator extends SubsystemBase {
    private VictorSP motor1;
    private VictorSP motor2;

    public Elevator() {
        motor1 = new VictorSP(ElevatorConstants.kMotor1PWM);
        motor2 = new VictorSP(ElevatorConstants.kMotor2PWM);

        motor1.addFollower(motor2);
    }

    public Command setSpeed(DoubleSupplier speed) {
        return run(() -> {
            motor1.set(speed.getAsDouble());
        });
    }

    public Command stop() {
        return setSpeed(() -> 0);
    }
}
