12 #include <hal/Types.h>
13 #include <wpi/raw_ostream.h>
15 #include "frc/ErrorBase.h"
16 #include "frc/MotorSafety.h"
17 #include "frc/smartdashboard/SendableBase.h"
35 enum Value { kOff, kOn, kForward, kReverse };
36 enum Direction { kBothDirections, kForwardOnly, kReverseOnly };
47 explicit Relay(
int channel, Direction direction = kBothDirections);
74 void Set(Value value);
88 int GetChannel()
const;
91 void StopMotor()
override;
99 Direction m_direction;
101 HAL_RelayHandle m_forwardHandle = HAL_kInvalidHandle;
102 HAL_RelayHandle m_reverseHandle = HAL_kInvalidHandle;
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
Value Get() const
Get the Relay State.
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Class for Spike style relay outputs.
Definition: Relay.h:33
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
This base class runs a watchdog timer and calls the subclass's StopMotor() function if the timeout ex...
Definition: MotorSafety.h:26
Relay(int channel, Direction direction=kBothDirections)
Relay constructor given a channel.
void Set(Value value)
Set the relay state.
~Relay() override
Free the resource associated with a relay.
Definition: SendableBase.h:19
Definition: SendableBuilder.h:23