added good ramp code

This commit is contained in:
dkbug 2016-02-20 15:45:47 -05:00
parent d6d7a52a6a
commit 220862a63e
2 changed files with 9 additions and 12 deletions

View File

@ -119,26 +119,23 @@ private:
//bool rampDoing = false; //bool rampDoing = false;
// This is shit code for testing. Replace it with real code. // 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."; std::cout << "Lowering Ramp.";
//ramp.Set(-1); //ramp.Set(-1);
shooter.LowerRamp(); shooter.LowerRamp();
ramping = true; ramping = true;
} }
/*else if(!ramping && operator_stick.GetRawButton(TRIGGER)) else if(!ramping
{ && !operator_stick.GetRawButton(RAMP_RAISE))
shooter.BoostRamp();
ramping = true;
}*/
else if(ramping
&& !operator_stick.GetRawButton(RAMP_LOWER)
&& ramp.GetForwardLimitOK())
{ {
shooter.RaiseRamp(); shooter.RaiseRamp();
ramping = true;
} }
else else if(ramping && !operator_stick.GetRawButton(RAMP_RAISE)
&& !operator_stick.GetRawButton(RAMP_LOWER))
{ {
shooter.StopRamp();
ramping = false; ramping = false;
} }

View File

@ -64,7 +64,7 @@ public:
void LowerRamp() void LowerRamp()
{ {
ramp->Set(-1); ramp->Set(-0.5);
if(ramp->Limits::kReverseLimit){ if(ramp->Limits::kReverseLimit){
SmartDashboard::PutNumber("ramp", 2); //going to put a circlar dial to show where the ramp could be SmartDashboard::PutNumber("ramp", 2); //going to put a circlar dial to show where the ramp could be
} else { } else {
@ -74,7 +74,7 @@ public:
void RaiseRamp() void RaiseRamp()
{ {
ramp->Set(1); ramp->Set(0.5);
if(ramp->Limits::kForwardLimit){ if(ramp->Limits::kForwardLimit){
SmartDashboard::PutNumber("ramp", 0); //going to put a circlar dial to show where the ramp could be SmartDashboard::PutNumber("ramp", 0); //going to put a circlar dial to show where the ramp could be
} else { } else {