From 1f09e12f2d567365c74c8ef5845d984397926749 Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Mon, 15 Feb 2016 20:54:20 -0500 Subject: [PATCH] tweaks - untested --- Robot2016/src/Robot.cpp | 8 ++++++-- Robot2016/src/Shooter.h | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Robot2016/src/Robot.cpp b/Robot2016/src/Robot.cpp index 1af8deb..b12359c 100644 --- a/Robot2016/src/Robot.cpp +++ b/Robot2016/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/Robot2016/src/Shooter.h b/Robot2016/src/Shooter.h index c8980f5..9c8af1e 100644 --- a/Robot2016/src/Shooter.h +++ b/Robot2016/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"; }