mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 08:48:01 -06:00
Added Elevator Subystem
Added method to make it move
This commit is contained in:
@@ -7,24 +7,42 @@
|
||||
|
||||
package frc4388.robot.subsystems;
|
||||
|
||||
import com.ctre.phoenix.motorcontrol.InvertType;
|
||||
import com.ctre.phoenix.motorcontrol.NeutralMode;
|
||||
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc4388.robot.Constants.ElevatorConstants;
|
||||
|
||||
public class Elevator extends SubsystemBase {
|
||||
|
||||
public WPI_TalonSRX m_talon1;
|
||||
public WPI_TalonSRX m_talon2;
|
||||
|
||||
public WPI_TalonSRX m_talon1 = new WPI_TalonSRX(ElevatorConstants.TALON_1);
|
||||
public WPI_TalonSRX m_talon2 = new WPI_TalonSRX(ElevatorConstants.TALON_2);
|
||||
|
||||
/**
|
||||
* Creates a new Elevator.
|
||||
*/
|
||||
public Elevator() {
|
||||
m_talon1.configFactoryDefault();
|
||||
m_talon2.configFactoryDefault();
|
||||
|
||||
m_talon2.follow(m_talon1);
|
||||
|
||||
m_talon1.setNeutralMode(NeutralMode.Brake);
|
||||
m_talon2.setNeutralMode(NeutralMode.Brake);
|
||||
|
||||
m_talon1.setInverted(false);
|
||||
m_talon2.setInverted(false);
|
||||
m_talon1.setInverted(InvertType.FollowMaster);
|
||||
m_talon2.setInverted(InvertType.FollowMaster);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
public void moveElevator(double speed) {
|
||||
m_talon1.set(speed);
|
||||
m_talon2.set(speed);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user