Made shooter_power private instead of global because that actually makes sense.
This commit is contained in:
parent
f5e438f15f
commit
08bc03df1c
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user