From: Logan Howard Date: Sat, 18 Apr 2015 02:21:52 +0000 (-0700) Subject: conform to all command based X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F3501-spark-go;a=commitdiff_plain;h=c0ffc2dea59ac12eba1192d52b59bbb9a1eedd5d conform to all command based --- diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 633cde6..67f54e1 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -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); + } }