Made sure shooter power from the throttle will only be used when the throttle is moved. Probably.
This commit is contained in:
parent
fac8abd43e
commit
38c09abe08
@ -19,6 +19,7 @@ class Robot: public IterativeRobot
|
|||||||
RobotDrive drive;
|
RobotDrive drive;
|
||||||
Shooter shooter;
|
Shooter shooter;
|
||||||
Joystick driver_stick, operator_stick;
|
Joystick driver_stick, operator_stick;
|
||||||
|
float power;
|
||||||
public:
|
public:
|
||||||
Robot():
|
Robot():
|
||||||
left_drive(0), // Left DriveTrain Talons plug into PWM channel 1 with a Y-splitter
|
left_drive(0), // Left DriveTrain Talons plug into PWM channel 1 with a Y-splitter
|
||||||
@ -100,6 +101,7 @@ private:
|
|||||||
{
|
{
|
||||||
shooter.CalibrateRamp();
|
shooter.CalibrateRamp();
|
||||||
shooter.SetRamp(Shoot); // start in the full up position!
|
shooter.SetRamp(Shoot); // start in the full up position!
|
||||||
|
power = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TeleopPeriodic()
|
void TeleopPeriodic()
|
||||||
@ -143,10 +145,14 @@ private:
|
|||||||
inverting = false;
|
inverting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float power = (1.0 - operator_stick.GetThrottle()) / 2.0;
|
if(((1.0 - operator_stick.GetThrottle()) / 2.0) > power + 0.005||((1.0 - operator_stick.GetThrottle()) / 2.0) < power -0.005)
|
||||||
shooter.SetPower(power);
|
{
|
||||||
|
power = (1.0 - operator_stick.GetThrottle()) / 2.0;
|
||||||
|
shooter.SetPower(power);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestPeriodic()
|
void TestPeriodic()
|
||||||
{
|
{
|
||||||
lw->Run();
|
lw->Run();
|
||||||
|
Reference in New Issue
Block a user