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;
// 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;
}

View File

@ -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 {