|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.wpi.first.wpilibj.SensorBase edu.wpi.first.wpilibj.Relay
public class Relay
Class for Spike style relay outputs. Relays are intended to be connected to spikes or similar relays. The relay channels controls a pair of pins that are either both off, one on, the other on, or both on. This translates into two spike outputs at 0v, one at 12v and one at 0v, one at 0v and the other at 12v, or two spike outputs at 12V. This allows off, full forward, or full reverse control of motors without variable speed. It also allows the two channels (forward and reverse) to be used independently for something that does not care about voltage polatiry (like a solenoid).
Nested Class Summary | |
---|---|
static class |
Relay.Direction
The Direction(s) that a relay is configured to operate in. |
class |
Relay.InvalidValueException
This class represents errors in trying to set realy values contradictory to the direction to which the relay is set. |
static class |
Relay.Value
The state to drive a Relay to. |
Field Summary |
---|
Fields inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond, n_simProperties |
Constructor Summary | |
---|---|
Relay(int channel)
Relay constructor given a channel only where the default digital module is used, allowing both directions. |
|
Relay(int moduleNumber,
int channel)
Relay constructor given the module and the channel, allowing both directions. |
|
Relay(int moduileNumber,
int channel,
Relay.Direction direction)
Relay constructor given the module and the channel. |
|
Relay(int channel,
Relay.Direction direction)
Relay constructor given a channel only where the default digital module is used. |
Method Summary | |
---|---|
void |
free()
Free the resources used by this object |
void |
set(Relay.Value value)
Set the relay state. |
void |
setDirection(Relay.Direction direction)
Set the Relay Direction Changes which values the relay can be set to depending on which direction is used Valid inputs are kBothDirections, kForwardOnly, and kReverseOnly |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Relay(int moduileNumber, int channel, Relay.Direction direction)
moduileNumber
- The number of the digital module to use.channel
- The channel number within the module for this relay.direction
- The direction that the Relay object will control.public Relay(int channel, Relay.Direction direction)
channel
- The channel number within the default module for this relay.direction
- The direction that the Relay object will control.public Relay(int moduleNumber, int channel)
moduleNumber
- The number of the digital module to use.channel
- The channel number within the module for this relay.public Relay(int channel)
channel
- The channel number within the default module for this relay.Method Detail |
---|
public void free()
SensorBase
free
in class SensorBase
public void set(Relay.Value value)
value
- The state to set the relay.public void setDirection(Relay.Direction direction)
direction
- The direction for the relay to operate in
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |