Changed subsystem variables to private where applicable

May need to be changed later, but try to use methods to access these variables instead of accessing them directly, as it fits better with the command based model and will be easier to rewrite should motors change, usage changes, etc.
This commit is contained in:
Keenan D. Buckley
2020-03-27 13:42:20 -06:00
parent 4271a66d1a
commit 17fbc03999
2 changed files with 12 additions and 8 deletions
@@ -27,12 +27,12 @@ public class Drive extends SubsystemBase {
// Put methods for controlling this subsystem
// here. Call these from Commands.
public WPI_TalonSRX m_leftFrontMotor = new WPI_TalonSRX(DriveConstants.DRIVE_LEFT_FRONT_CAN_ID);
public WPI_TalonSRX m_rightFrontMotor = new WPI_TalonSRX(DriveConstants.DRIVE_RIGHT_FRONT_CAN_ID);
public WPI_TalonSRX m_leftBackMotor = new WPI_TalonSRX(DriveConstants.DRIVE_LEFT_BACK_CAN_ID);
public WPI_TalonSRX m_rightBackMotor = new WPI_TalonSRX(DriveConstants.DRIVE_RIGHT_BACK_CAN_ID);
public DifferentialDrive m_driveTrain = new DifferentialDrive(m_leftFrontMotor, m_rightFrontMotor);
public RobotGyro m_gyro = new RobotGyro(new PigeonIMU(DriveConstants.DRIVE_PIGEON_ID));
private WPI_TalonSRX m_leftFrontMotor = new WPI_TalonSRX(DriveConstants.DRIVE_LEFT_FRONT_CAN_ID);
private WPI_TalonSRX m_rightFrontMotor = new WPI_TalonSRX(DriveConstants.DRIVE_RIGHT_FRONT_CAN_ID);
private WPI_TalonSRX m_leftBackMotor = new WPI_TalonSRX(DriveConstants.DRIVE_LEFT_BACK_CAN_ID);
private WPI_TalonSRX m_rightBackMotor = new WPI_TalonSRX(DriveConstants.DRIVE_RIGHT_BACK_CAN_ID);
private DifferentialDrive m_driveTrain = new DifferentialDrive(m_leftFrontMotor, m_rightFrontMotor);
private RobotGyro m_gyro = new RobotGyro(new PigeonIMU(DriveConstants.DRIVE_PIGEON_ID));
/**
* Add your docs here.
@@ -77,6 +77,10 @@ public class Drive extends SubsystemBase {
m_driveTrain.arcadeDrive(move, steer);
}
public RobotGyro getRobotGyro(){
return m_gyro;
}
private void updateSmartDashboard() {
// Examples of the functionality of RobotGyro
@@ -20,8 +20,8 @@ import frc4388.utility.LEDPatterns;
*/
public class LED extends SubsystemBase {
public float currentLED;
public Spark LEDController;
private float currentLED;
private Spark LEDController;
/**
* Add your docs here.