diff --git a/Robot2016/src/Robot.cpp b/Robot2016/src/Robot.cpp index f867ef5..e362cc1 100644 --- a/Robot2016/src/Robot.cpp +++ b/Robot2016/src/Robot.cpp @@ -19,6 +19,8 @@ #define RAMP_LOWER 3 // Button 4 to lower ramp. #define UNJAM 11 +#define ARMS_SCALE 0.75 + #define DEADZONE_RADIUS 0.05 // Deadzone Radius prevents tiny twitches in the joystick's value from // affecting the robot. Use this for cleaning up drive train and shooter. // Also used for detecting changes in an axis' value. @@ -389,38 +391,13 @@ public: { inverting = false; } - - - /* - * Unlike the previous actions, this method does need to be called every iteration of - * TeleopPeriodic. This is because the logic running this operation needs to be checked - * Every time the method is called. This cannot be a loop in the Shoot method because - * that would lock the robot every time the trigger is hit. - */ - if(operator_stick.GetRawButton(TRIGGER) || (shooter.GetState() != 0)) + + if(operator_stick.GetRawButton(4)) { - shooting = true; - shooter.Shoot(); + arms.Set(-operator_stick.GetY() * ARMS_SCALE); } - else if(shooting && !operator_stick.GetRawButton(TRIGGER)) + else { - shooting = false; - shooter.StopShooter(); - } - - if(!arming && driver_stick.GetRawButton(RAMP_RAISE)) - { - arming = true; - arms.Set(1); - } - else if(!arming && driver_stick.GetRawButton(RAMP_LOWER)) - { - arming = true; - arms.Set(-1); - } - else if(arming && !driver_stick.GetRawButton(RAMP_RAISE) && !driver_stick.GetRawButton(RAMP_LOWER)) - { - arming = false; arms.Set(0); }