From ce69ef14b67b3e3188b7bc6c9bda218e4a5daaec Mon Sep 17 00:00:00 2001 From: dkbug Date: Sat, 20 Feb 2016 15:45:47 -0500 Subject: [PATCH] added good ramp code --- Robot2016/src/Robot.cpp | 17 +++++++---------- Robot2016/src/Shooter.h | 4 ++-- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Robot2016/src/Robot.cpp b/Robot2016/src/Robot.cpp index 7117b87..196bdc1 100644 --- a/Robot2016/src/Robot.cpp +++ b/Robot2016/src/Robot.cpp @@ -119,26 +119,23 @@ private: //bool rampDoing = false; // This is shit code for testing. Replace it with real code. - if(operator_stick.GetRawButton(RAMP_LOWER)) + if(!ramping && operator_stick.GetRawButton(RAMP_LOWER)) { std::cout << "Lowering Ramp."; //ramp.Set(-1); shooter.LowerRamp(); ramping = true; } - /*else if(!ramping && operator_stick.GetRawButton(TRIGGER)) - { - shooter.BoostRamp(); - ramping = true; - }*/ - else if(ramping - && !operator_stick.GetRawButton(RAMP_LOWER) - && ramp.GetForwardLimitOK()) + else if(!ramping + && !operator_stick.GetRawButton(RAMP_RAISE)) { shooter.RaiseRamp(); + ramping = true; } - else + else if(ramping && !operator_stick.GetRawButton(RAMP_RAISE) + && !operator_stick.GetRawButton(RAMP_LOWER)) { + shooter.StopRamp(); ramping = false; } diff --git a/Robot2016/src/Shooter.h b/Robot2016/src/Shooter.h index 562bf75..257d661 100644 --- a/Robot2016/src/Shooter.h +++ b/Robot2016/src/Shooter.h @@ -64,7 +64,7 @@ public: void LowerRamp() { - ramp->Set(-1); + ramp->Set(-0.5); if(ramp->Limits::kReverseLimit){ SmartDashboard::PutNumber("ramp", 2); //going to put a circlar dial to show where the ramp could be } else { @@ -74,7 +74,7 @@ public: void RaiseRamp() { - ramp->Set(1); + ramp->Set(0.5); if(ramp->Limits::kForwardLimit){ SmartDashboard::PutNumber("ramp", 0); //going to put a circlar dial to show where the ramp could be } else {