The intake subsystem is expected to be motor driven. There may be another control added later to extend the ball pickup. For the moment we will assume that we just need to add a motor to turn the intake pickup, but we need to be able to reverse this motor.
The subsystem should be a new file in the subsystem folder. Because we are testing on the existing robot (Infinite Recharge) we will use the first intake motor as an example.
The CAN bus id for this motor is listed as 9 and it should be a Talon SRX, but this should be verified by checking the label on the motor controllers of the robot. Once verified add the correct address into the Constants.
public static final int firstintakeMotor = 9; //Talon SRX
If the drivers are installed on your computer the motor drive can be imported with:
The Infinite Recharge code can be used as an example, but it has more than we need to do at the moment. Just use the startFirstIntake, reverseFirstIntake and stopFirstIntake methods and use booleans to track the status. The booleans can be used to display the status on the SmartDashboard. The speed that the motor runs at should be set in Constants.java
To connect this command to a button on the joystick and something like:
Button intake_a_button = new JoystickButton(m_rightJoy,3).whenPressed(new FirstintakeToggle());
Into RobotContainer in the configureButtonBindings method. You will also need to add the instantiation of the subsystem into RobotContainer, this should be similar to what is done for the DriveTrain, something like:
private static final Intake m_intake = new Intake();
Description
The intake subsystem is expected to be motor driven. There may be another control added later to extend the ball pickup. For the moment we will assume that we just need to add a motor to turn the intake pickup, but we need to be able to reverse this motor.
The subsystem should be a new file in the subsystem folder. Because we are testing on the existing robot (Infinite Recharge) we will use the first intake motor as an example.
The CAN bus id for this motor is listed as 9 and it should be a Talon SRX, but this should be verified by checking the label on the motor controllers of the robot. Once verified add the correct address into the Constants.
If the drivers are installed on your computer the motor drive can be imported with:
The Infinite Recharge code can be used as an example, but it has more than we need to do at the moment. Just use the startFirstIntake, reverseFirstIntake and stopFirstIntake methods and use booleans to track the status. The booleans can be used to display the status on the SmartDashboard. The speed that the motor runs at should be set in Constants.java
To add the command to toggle the Intake on and off add a new file under commands:
To connect this command to a button on the joystick and something like:
Into RobotContainer in the configureButtonBindings method. You will also need to add the instantiation of the subsystem into RobotContainer, this should be similar to what is done for the DriveTrain, something like: