Relay Class Reference

#include <Relay.h>

Inheritance diagram for Relay:

Inheritance graph
[legend]
Collaboration diagram for Relay:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Relay (unsigned channel, Direction direction=kBothDirections)
 Relay (unsigned slot, unsigned channel, Direction direction=kBothDirections)
 ~Relay (void)
void Set (Value value)


Detailed Description

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).

Constructor & Destructor Documentation

Relay::Relay ( unsigned  channel,
Relay::Direction  direction = kBothDirections 
)

Relay constructor given a channel only where the default digital module is used.

Parameters:
channel The channel number within the default module for this relay.
direction The direction that the Relay object will control.

Relay::Relay ( unsigned  slot,
unsigned  channel,
Relay::Direction  direction = kBothDirections 
)

Relay constructor given the module and the channel.

Parameters:
slot The module slot number this relay is connected to.
channel The channel number within the module for this relay.
direction The direction that the Relay object will control.

Relay::~Relay ( void   ) 

Free the resource associated with a relay. The relay channels are set to free and the relay output is turned off.


Member Function Documentation

void Relay::Set ( Relay::Value  value  ) 

Set the relay state.

Valid values depend on which directions of the relay are controlled by the object.

When set to kBothDirections, the relay can only be one of the three reasonable values, 0v-0v, 0v-12v, or 12v-0v.

When set to kForwardOnly or kReverseOnly, you can specify the constant for the direction or you can simply specify kOff and kOn. Using only kOff and kOn is recommended.

Parameters:
value The state to set the relay.


The documentation for this class was generated from the following files:

Generated on Thu Oct 2 14:01:30 2008 for WPI Robotics Library by  doxygen 1.5.5