diff --git a/src/Robot.cpp b/src/Robot.cpp index 1af8deb..b12359c 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -163,7 +163,7 @@ private: /* * Run the Shooter only while the THUMB button is held down on the operator stick. * the 'pickupRunning' boolean is there to prevent the shooter from calling PickUp - * every itteration of the TeleopPeriodic method (once every 10ms!) + * every iteration of the TeleopPeriodic method (once every 10ms!) * The pickup is disabled when the thumb button is released, but the code still * has 'pickupRunning' as true. */ @@ -177,10 +177,14 @@ private: shooter.PickUp(false); pickupRunning = false; } + else if(launch_spinny.Get() != 1) + { + launch_spinny.Set(1); + } /* * The 'inverting' variable is used to make sure that the drive train isn't getting - * inverted every itteration of the TeleopPeriodic method while the button is held down. + * inverted every iteration of the TeleopPeriodic method while the button is held down. * This is important because the TeleopPeriodic method executes something like once every 10ms. * Thus, this if-else if pair make the button a toggle. */ diff --git a/src/Shooter.h b/src/Shooter.h index c8980f5..9c8af1e 100644 --- a/src/Shooter.h +++ b/src/Shooter.h @@ -84,13 +84,10 @@ public: void Shoot() { - // TODO: Shooter Logic should go as follows: - - /* - Assuming a ball is held in the shooter. When the trigger is pulled, - the launch-spinny should be STOPPED. Start a Timer object counting - When... too hard to write.. I emailed you a flow chart. - */ + if (shotClock.Get() > (SPINUP_TIME + 0.1)) + { + state = RESETTING; + } switch (state) { case READY: @@ -152,7 +149,13 @@ public: { pickup->Set((float) (state * PICKUP_POWER)); launcher->Set((float) (state * PICKUP_POWER * -1)); - //launch_spinny->Set(-1.0*PICKUP_POWER); + if (state) + { + launch_spinny->Set(-1.0); + } else + { + launch_spinny->Set(1); + } //std::cout << "picking up!\n"; }