diff --git a/Robot2016/src/Robot.cpp b/Robot2016/src/Robot.cpp index 4913f17..2e61871 100644 --- a/Robot2016/src/Robot.cpp +++ b/Robot2016/src/Robot.cpp @@ -19,7 +19,6 @@ class Robot: public IterativeRobot RobotDrive drive; Shooter shooter; Joystick driver_stick, operator_stick; - float power; public: Robot(): left_drive(0), // Left DriveTrain Talons plug into PWM channel 1 with a Y-splitter @@ -40,6 +39,7 @@ private: // instance variables bool pickupRunning; // don't want to spam the Talon with set messages. Toggle the pickup when a button is pressed or released. bool inverting; + float shooter_power; LiveWindow *lw = LiveWindow::GetInstance(); SendableChooser *chooser; @@ -145,10 +145,10 @@ private: inverting = false; } - if(((1.0 - operator_stick.GetThrottle()) / 2.0) > power + 0.005||((1.0 - operator_stick.GetThrottle()) / 2.0) < power -0.005) + if(((1.0 - operator_stick.GetThrottle()) / 2.0) > shooter_power + 0.005||((1.0 - operator_stick.GetThrottle()) / 2.0) < shooter_power -0.005) { - power = (1.0 - operator_stick.GetThrottle()) / 2.0; - shooter.SetPower(power); + shooter_power = (1.0 - operator_stick.GetThrottle()) / 2.0; + shooter.SetPower(shooter_power); } }