conform to all command based
authorLogan Howard <logan@oflogan.com>
Sat, 18 Apr 2015 02:21:52 +0000 (19:21 -0700)
committerLogan Howard <logan@oflogan.com>
Sat, 18 Apr 2015 02:21:52 +0000 (19:21 -0700)
src/org/usfirst/frc/team3501/robot/Robot.java

index 633cde60b724bafc01ef82cf73ce10b8d3fb2c58..67f54e14fcdf1ef00265ff0b25306c193670308e 100644 (file)
@@ -9,6 +9,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
 import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
 
 import org.usfirst.frc.team3501.robot.autons.*;
+import org.usfirst.frc.team3501.robot.commands.*;
 import org.usfirst.frc.team3501.robot.subsystems.*;
 
 public class Robot extends IterativeRobot {
@@ -42,7 +43,7 @@ public class Robot extends IterativeRobot {
        }
 
     public void autonomousInit() {
-        pneumatics.start();
+        schedule(new TurnOnCompressor());
 
         autonomousCommand = (Command) autoChooser.getSelected();
         autonomousCommand.start();
@@ -53,7 +54,7 @@ public class Robot extends IterativeRobot {
     }
 
     public void teleopInit() {
-        pneumatics.start();
+        schedule(new TurnOnCompressor());
 
         autonomousCommand.cancel();
     }
@@ -67,7 +68,7 @@ public class Robot extends IterativeRobot {
     }
 
     public void disabledInit() {
-        pneumatics.stop();
+        schedule(new TurnOffCompressor());
     }
 
     private void chooseAuto() {
@@ -79,4 +80,8 @@ public class Robot extends IterativeRobot {
 
         SmartDashboard.putData("Auto Mode", autoChooser);
     }
+
+    private void schedule(Command c) {
+        Scheduler.getInstance().add(c);
+    }
 }