From 08bc03df1c501783039984055244eef0efa236b2 Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Thu, 11 Feb 2016 16:18:58 -0500 Subject: [PATCH] Made shooter_power private instead of global because that actually makes sense. --- src/Robot.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 4913f17..2e61871 100644 --- a/src/Robot.cpp +++ b/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); } }