diff --git a/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp index 15a1be02f3..5af7aba191 100644 --- a/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp @@ -40,7 +40,7 @@ class Robot : public frc::TimedRobot { .IfHigh([&intake = m_intake] { intake.Set(0.5); }); // if the thumb button is not held - (intakeButton + (!intakeButton // or there is a ball in the kicker || isBallAtKicker) // stop the intake @@ -59,7 +59,7 @@ class Robot : public frc::TimedRobot { ff.Calculate(SHOT_VELOCITY)); }); // if not, stop - shootTrigger.IfHigh([&shooter = m_shooter] { shooter.Set(0.0); }); + (!shootTrigger).IfHigh([&shooter = m_shooter] { shooter.Set(0.0); }); frc::BooleanEvent atTargetVelocity = frc::BooleanEvent( diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/eventloop/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/eventloop/Robot.java index b4619ae7bb..03c5577157 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/eventloop/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/eventloop/Robot.java @@ -50,6 +50,7 @@ public class Robot extends TimedRobot { // if the thumb button is not held intakeButton + .negate() // or there is a ball in the kicker .or(isBallAtKicker) // stop the intake @@ -66,7 +67,7 @@ public class Robot extends TimedRobot { m_controller.calculate(m_shooterEncoder.getRate(), SHOT_VELOCITY) + m_ff.calculate(SHOT_VELOCITY))); // if not, stop - shootTrigger.ifHigh(m_shooter::stopMotor); + shootTrigger.negate().ifHigh(m_shooter::stopMotor); BooleanEvent atTargetVelocity = new BooleanEvent(m_loop, m_controller::atSetpoint)