diff --git a/.gradle/4.4/fileHashes/fileHashes.bin b/.gradle/4.4/fileHashes/fileHashes.bin
index a1e255c..464e284 100644
Binary files a/.gradle/4.4/fileHashes/fileHashes.bin and b/.gradle/4.4/fileHashes/fileHashes.bin differ
diff --git a/.gradle/4.4/fileHashes/fileHashes.lock b/.gradle/4.4/fileHashes/fileHashes.lock
index cdee769..d54f0b0 100644
Binary files a/.gradle/4.4/fileHashes/fileHashes.lock and b/.gradle/4.4/fileHashes/fileHashes.lock differ
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 02c9a25..87ad982 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -4,6 +4,8 @@
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 77e9972..617e861 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -5,12 +5,13 @@
-
+
+
diff --git a/.idea/libraries/Gradle__edu_wpi_first_cscore_cscore_java_1_1_0.xml b/.idea/libraries/Gradle__edu_wpi_first_cscore_cscore_java_1_1_0.xml
index df46b41..92b8ef0 100644
--- a/.idea/libraries/Gradle__edu_wpi_first_cscore_cscore_java_1_1_0.xml
+++ b/.idea/libraries/Gradle__edu_wpi_first_cscore_cscore_java_1_1_0.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__edu_wpi_first_ntcore_ntcore_java_4_0_0.xml b/.idea/libraries/Gradle__edu_wpi_first_ntcore_ntcore_java_4_0_0.xml
index dbd3739..0e26cd5 100644
--- a/.idea/libraries/Gradle__edu_wpi_first_ntcore_ntcore_java_4_0_0.xml
+++ b/.idea/libraries/Gradle__edu_wpi_first_ntcore_ntcore_java_4_0_0.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__edu_wpi_first_wpilibj_wpilibj_java_2018_1_1.xml b/.idea/libraries/Gradle__edu_wpi_first_wpilibj_wpilibj_java_2018_1_1.xml
index b03b5df..6e126da 100644
--- a/.idea/libraries/Gradle__edu_wpi_first_wpilibj_wpilibj_java_2018_1_1.xml
+++ b/.idea/libraries/Gradle__edu_wpi_first_wpilibj_wpilibj_java_2018_1_1.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__edu_wpi_first_wpiutil_wpiutil_java_3_0_0.xml b/.idea/libraries/Gradle__edu_wpi_first_wpiutil_wpiutil_java_3_0_0.xml
index b8f1e30..bfdf46d 100644
--- a/.idea/libraries/Gradle__edu_wpi_first_wpiutil_wpiutil_java_3_0_0.xml
+++ b/.idea/libraries/Gradle__edu_wpi_first_wpiutil_wpiutil_java_3_0_0.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__openrio_mirror_third_ctre_CTRE_phoenix_java_5_1_2_1.xml b/.idea/libraries/Gradle__openrio_mirror_third_ctre_CTRE_phoenix_java_5_1_2_1.xml
index ae7d24f..d33dd26 100644
--- a/.idea/libraries/Gradle__openrio_mirror_third_ctre_CTRE_phoenix_java_5_1_2_1.xml
+++ b/.idea/libraries/Gradle__openrio_mirror_third_ctre_CTRE_phoenix_java_5_1_2_1.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__openrio_mirror_third_kauailabs_navx_java_3_0_342.xml b/.idea/libraries/Gradle__openrio_mirror_third_kauailabs_navx_java_3_0_342.xml
index 6193fae..b185fc5 100644
--- a/.idea/libraries/Gradle__openrio_mirror_third_kauailabs_navx_java_3_0_342.xml
+++ b/.idea/libraries/Gradle__openrio_mirror_third_kauailabs_navx_java_3_0_342.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__openrio_powerup_MatchData_2018_01_07.xml b/.idea/libraries/Gradle__openrio_powerup_MatchData_2018_01_07.xml
index da7eacf..74f21d1 100644
--- a/.idea/libraries/Gradle__openrio_powerup_MatchData_2018_01_07.xml
+++ b/.idea/libraries/Gradle__openrio_powerup_MatchData_2018_01_07.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__org_opencv_opencv_java_3_2_0.xml b/.idea/libraries/Gradle__org_opencv_opencv_java_3_2_0.xml
index cdf1694..0cc0410 100644
--- a/.idea/libraries/Gradle__org_opencv_opencv_java_3_2_0.xml
+++ b/.idea/libraries/Gradle__org_opencv_opencv_java_3_2_0.xml
@@ -1,11 +1,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 9b11cf9..dffc1ad 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,9 +2,9 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/-838270129/RobotCode_2018.iml b/.idea/modules/-838270129/RobotCode_2018.iml
new file mode 100644
index 0000000..afce1f5
--- /dev/null
+++ b/.idea/modules/-838270129/RobotCode_2018.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/-838270129/RobotCode_2018_main.iml b/.idea/modules/-838270129/RobotCode_2018_main.iml
new file mode 100644
index 0000000..a421678
--- /dev/null
+++ b/.idea/modules/-838270129/RobotCode_2018_main.iml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/-838270129/RobotCode_2018_test.iml b/.idea/modules/-838270129/RobotCode_2018_test.iml
new file mode 100644
index 0000000..b4a8945
--- /dev/null
+++ b/.idea/modules/-838270129/RobotCode_2018_test.iml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7..9f7d9ba 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,7 @@
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8d338f2..9f2c1b1 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,13 +2,17 @@
-
+
+
+
+
+
+
-
@@ -26,54 +30,144 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
+
+
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
-
-
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -83,18 +177,24 @@
-
+
+
+
+ runinta
+
+
-
+
+
@@ -107,15 +207,15 @@
-
+
-
-
+
+
@@ -124,254 +224,254 @@
@@ -392,185 +496,183 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
-
-
-
+
+
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
-
-
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
-
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
+
+
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
+
-
-
-
+
-
-
+
+
+
+
+
+
+
-
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
-
-
+
+
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
+
+
+
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
+
+
+
+
+
-
+
-
-
-
+
+
diff --git a/src/main/java/frc/team2158/robot/Robot.java b/src/main/java/frc/team2158/robot/Robot.java
index e216abe..8bfa62e 100644
--- a/src/main/java/frc/team2158/robot/Robot.java
+++ b/src/main/java/frc/team2158/robot/Robot.java
@@ -10,6 +10,7 @@
import frc.team2158.robot.command.drive.ToggleGearMode;
import frc.team2158.robot.command.intake.*;
import frc.team2158.robot.command.lift.MoveLift;
+import frc.team2158.robot.subsystem.FlywheelSubsystem;
import frc.team2158.robot.subsystem.drive.DriveSubsystem;
import frc.team2158.robot.subsystem.drive.GearMode;
import frc.team2158.robot.subsystem.drive.TalonSRXGroup;
@@ -34,6 +35,7 @@ public class Robot extends TimedRobot {
private static DriveSubsystem driveSubsystem;
private static LiftSubsystem liftSubsystem;
private static IntakeSubsystem intakeSubsystem;
+ private static FlywheelSubsystem flywheelSubsystem;
private static OperatorInterface operatorInterface;
private Spark blinkin = new Spark(6);
@@ -158,6 +160,13 @@ public static IntakeSubsystem getIntakeSubsystem() {
throw new RuntimeException("Intake subsystem has not yet been initialized!");
}
+ public static FlywheelSubsystem getFlywheelSubsystem() {
+ if(flywheelSubsystem != null) {
+ return flywheelSubsystem;
+ }
+ throw new RuntimeException("Flywheel subsystem has not yet been initialized!");
+ }
+
/**
* Returns the instance of the Operator Interface.
* @return the instance of the Operator Interface.
diff --git a/src/main/java/frc/team2158/robot/command/stopFlywheel.java b/src/main/java/frc/team2158/robot/command/stopFlywheel.java
new file mode 100644
index 0000000..be1dcfb
--- /dev/null
+++ b/src/main/java/frc/team2158/robot/command/stopFlywheel.java
@@ -0,0 +1,24 @@
+package frc.team2158.robot.command;
+
+import edu.wpi.first.wpilibj.command.Command;
+import frc.team2158.robot.Robot;
+
+import java.util.logging.Logger;
+
+public class stopFlywheel extends Command {
+ private static final Logger LOGGER = Logger.getLogger(stopFlywheel.class.getName());
+
+ public stopFlywheel() {
+ requires(Robot.getFlywheelSubsystem());
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.getFlywheelSubsystem().stopFlywheel();
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+ }
diff --git a/src/main/java/frc/team2158/robot/subsystem/FlywheelSubsystem.java b/src/main/java/frc/team2158/robot/subsystem/FlywheelSubsystem.java
new file mode 100644
index 0000000..853626f
--- /dev/null
+++ b/src/main/java/frc/team2158/robot/subsystem/FlywheelSubsystem.java
@@ -0,0 +1,45 @@
+package frc.team2158.robot.subsystem;
+
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.command.Subsystem;
+import frc.team2158.robot.command.stopFlywheel;
+import frc.team2158.robot.subsystem.intake.IntakeSubsystem.IntakeDirection;
+/**
+ * @author William Blount
+ * @version 0.0.1
+ * This subsystem manages the cube intake motors and solenoids.
+ */
+public class FlywheelSubsystem extends Subsystem {
+
+ private static double flywheel_speed = 1.0;
+
+ private SpeedController speedController;
+
+ public FlywheelSubsystem(SpeedController speedController) {
+ this.speedController = speedController;
+ }
+
+ public void runFlywheel(double speed) {
+ speedController.set(speed);
+ }
+
+ /**
+ * Stops the intake by setting the speed controllers to 0.0
+ */
+ public void stopFlywheel() {
+ double intake_modified_speed = flywheel_speed;
+ for(double i = 0; i < 1.0; i = i+ .02){
+ speedController.set(intake_modified_speed-i);
+ }
+ speedController.set(0);
+ }
+
+ public void estopFlywheel() {
+ speedController.set(0);
+ }
+
+ @Override
+ protected void initDefaultCommand() {
+ setDefaultCommand(new stopFlywheel());
+ }
+}
diff --git a/src/main/java/frc/team2158/robot/subsystem/lift/LiftSubsystem.java b/src/main/java/frc/team2158/robot/subsystem/lift/LiftSubsystem.java
index 953c225..741d028 100644
--- a/src/main/java/frc/team2158/robot/subsystem/lift/LiftSubsystem.java
+++ b/src/main/java/frc/team2158/robot/subsystem/lift/LiftSubsystem.java
@@ -1,6 +1,7 @@
package frc.team2158.robot.subsystem.lift;
import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Subsystem;
import frc.team2158.robot.command.lift.StopLift;
@@ -47,6 +48,10 @@ public void moveLift(Direction direction, double speed) {
* Stops the lift by setting the speed to zero.
*/
public void stopLift() {
+ for(double i = 0; i < 1.0; i = i+ .02){
+ liftSpeedController.set(DEFAULT_LIFT_UP_SPEED-i);
+ Timer.delay(.0025);
+ }
liftSpeedController.set(0.0);
}