import CANTalon from ctre instead of wpilib libraries
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / subsystems / DriveTrain.java
index 54b0ce01131b2dd8a376e98447b30703c5bc7317..d3d9edf18618f4f61946aefcb2650eb6424af36e 100644 (file)
@@ -1,19 +1,28 @@
 package org.usfirst.frc.team3501.robot.subsystems;
 
 import org.usfirst.frc.team3501.robot.Constants;
-import edu.wpi.first.wpilibj.CANTalon;
+
+import com.ctre.CANTalon;
+
 import edu.wpi.first.wpilibj.command.Subsystem;
 
 public class DriveTrain extends Subsystem {
+  private static DriveTrain driveTrain;
   private CANTalon frontLeft, frontRight, rearLeft, rearRight;
 
-  public DriveTrain() {
+  private DriveTrain() {
     frontLeft = new CANTalon(Constants.DriveTrain.FRONT_LEFT);
     frontRight = new CANTalon(Constants.DriveTrain.FRONT_RIGHT);
     rearLeft = new CANTalon(Constants.DriveTrain.REAR_LEFT);
     rearRight = new CANTalon(Constants.DriveTrain.REAR_RIGHT);
   }
 
+  public static DriveTrain getDriveTrain() {
+    if (driveTrain == null)
+      driveTrain = new DriveTrain();
+    return driveTrain;
+  }
+
   @Override
   protected void initDefaultCommand() {
   }