mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 00:38:00 -06:00
Set up leveler motor so that it can be run.
This commit is contained in:
@@ -70,11 +70,11 @@ public final class Constants {
|
||||
}
|
||||
|
||||
public static final class LevelerConstants {
|
||||
public static final int LEVELER_TALON_ID = 9;
|
||||
public static final int LEVELER_CAN_ID = 9;
|
||||
}
|
||||
|
||||
public static final class StorageConstants {
|
||||
public static final int STORAGE_CAN_ID = 9;
|
||||
public static final int STORAGE_CAN_ID = -1;
|
||||
public static final int BEAM_SENSOR_DIO_0 = 0;
|
||||
public static final int BEAM_SENSOR_DIO_1 = 1;
|
||||
public static final int BEAM_SENSOR_DIO_2 = 2;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class RobotContainer {
|
||||
m_robotIntake.setDefaultCommand(new RunIntakeWithTriggers(m_robotIntake, getOperatorController()));
|
||||
// continually sends updates to the Blinkin LED controller to keep the lights on
|
||||
m_robotLED.setDefaultCommand(new RunCommand(() -> m_robotLED.updateLED(), m_robotLED));
|
||||
// drives the robot with an axis input from the driver controller
|
||||
// drives the leveler with an axis input from the driver controller
|
||||
m_robotLeveler.setDefaultCommand(new RunLevelerWithJoystick(m_robotLeveler, getDriverController()));
|
||||
// runs storage motor at 50 percent
|
||||
m_robotStorage.setDefaultCommand(new RunCommand(() -> m_robotStorage.runStorage(0.0), m_robotStorage));
|
||||
|
||||
@@ -10,22 +10,23 @@ 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;
|
||||
import com.revrobotics.CANSparkMax;
|
||||
import com.revrobotics.CANSparkMax.IdleMode;
|
||||
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.wpilibj.Talon;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc4388.robot.Constants.LevelerConstants;
|
||||
|
||||
public class Leveler extends SubsystemBase {
|
||||
WPI_TalonSRX m_levelerMotor = new WPI_TalonSRX(LevelerConstants.LEVELER_TALON_ID);
|
||||
CANSparkMax m_levelerMotor = new CANSparkMax(LevelerConstants.LEVELER_CAN_ID, MotorType.kBrushless);
|
||||
|
||||
/**
|
||||
* Creates a new Leveler.
|
||||
*/
|
||||
public Leveler() {
|
||||
m_levelerMotor.configFactoryDefault();
|
||||
|
||||
m_levelerMotor.setNeutralMode(NeutralMode.Brake);
|
||||
|
||||
m_levelerMotor.restoreFactoryDefaults();
|
||||
m_levelerMotor.setIdleMode(IdleMode.kCoast);
|
||||
m_levelerMotor.setInverted(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user