2020-02-06 19:51:17 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
|
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
package frc4388.robot.subsystems;
|
|
|
|
|
|
|
|
|
|
import com.ctre.phoenix.motorcontrol.NeutralMode;
|
|
|
|
|
import com.ctre.phoenix.motorcontrol.can.TalonSRX;
|
|
|
|
|
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
2020-02-08 14:49:16 -07:00
|
|
|
import com.revrobotics.CANSparkMax;
|
|
|
|
|
import com.revrobotics.CANSparkMax.IdleMode;
|
|
|
|
|
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
2020-02-06 19:51:17 -07:00
|
|
|
|
|
|
|
|
import edu.wpi.first.wpilibj.Talon;
|
|
|
|
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|
|
|
|
import frc4388.robot.Constants.LevelerConstants;
|
|
|
|
|
|
|
|
|
|
public class Leveler extends SubsystemBase {
|
2020-02-08 14:49:16 -07:00
|
|
|
CANSparkMax m_levelerMotor = new CANSparkMax(LevelerConstants.LEVELER_CAN_ID, MotorType.kBrushless);
|
2020-02-06 19:51:17 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a new Leveler.
|
|
|
|
|
*/
|
|
|
|
|
public Leveler() {
|
2020-02-08 14:49:16 -07:00
|
|
|
m_levelerMotor.restoreFactoryDefaults();
|
2020-02-11 17:35:36 -07:00
|
|
|
|
|
|
|
|
m_levelerMotor.setIdleMode(IdleMode.kBrake);
|
2020-02-06 19:51:17 -07:00
|
|
|
m_levelerMotor.setInverted(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void periodic() {
|
|
|
|
|
// This method will be called once per scheduler run
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Runs intake motor
|
|
|
|
|
* @param input the percent output to run motor at
|
|
|
|
|
*/
|
|
|
|
|
public void runLeveler(double input) {
|
|
|
|
|
m_levelerMotor.set(input);
|
|
|
|
|
}
|
|
|
|
|
}
|