From e061b741cbc5528aa265f7279aca8962449cf376 Mon Sep 17 00:00:00 2001 From: Jason Cox Date: Fri, 12 Feb 2016 19:37:36 -0500 Subject: [PATCH] ramp reinstated --- src/Robot.cpp | 12 ++++++++++-- src/Shooter.h | 23 +++++++++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 6de81fa..8826677 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -112,17 +112,25 @@ private: // This is shit code for testing. Replace it with real code. if(operator_stick.GetRawButton(RAMP_RAISE)) { - launch_spinny.Set(1); + //launch_spinny.Set(1); + shooter.RaiseRamp(); } else if(operator_stick.GetRawButton(RAMP_LOWER)) { - launch_spinny.Set(-1); + //launch_spinny.Set(-1); + shooter.LowerRamp(); + } + else if(operator_stick.GetRawButton(TRIGGER)) + { + shooter.BoostRamp(); } else { launch_spinny.Set(0); } + + /* * 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 diff --git a/src/Shooter.h b/src/Shooter.h index f9892bd..b273940 100644 --- a/src/Shooter.h +++ b/src/Shooter.h @@ -45,9 +45,24 @@ public: void StopShooter() { ready = true; - launch_spinny.Set(0); - launcher.Set(0); - pickup.Set(0); + launch_spinny->Set(0); + launcher->Set(0); + pickup->Set(0); + } + + void LowerRamp() + { + launch_spinny->Set(-0.1); + } + + void RaiseRamp() + { + launch_spinny->Set(0.1); + } + + void BoostRamp() + { + launch_spinny->Set(0.5); } void Shoot() @@ -65,7 +80,7 @@ public: void PickUp(bool state = true) { pickup->Set((float) (state * PICKUP_POWER)); - launch_spinny->Set(-1.0*PICKUP_POWER); + //launch_spinny->Set(-1.0*PICKUP_POWER); std::cout << "picking up!\n"; }