[examples] Move triggers to subsystem fields (#6318)

This commit is contained in:
DeltaDizzy
2024-01-28 01:47:06 -06:00
committed by GitHub
parent 177132fa2a
commit 53ebb6679e
5 changed files with 18 additions and 22 deletions

View File

@@ -8,6 +8,7 @@
#include <frc/motorcontrol/PWMSparkMax.h>
#include <frc2/command/CommandPtr.h>
#include <frc2/command/SubsystemBase.h>
#include <frc2/command/button/Trigger.h>
#include "Constants.h"
@@ -19,7 +20,7 @@ class Storage : frc2::SubsystemBase {
frc2::CommandPtr RunCommand();
/** Whether the ball storage is full. */
bool IsFull() const;
frc2::Trigger HasCargo{[this] { return m_ballSensor.Get(); }};
private:
frc::PWMSparkMax m_motor{StorageConstants::kMotorPort};