Log in

View Full Version : Relay Code


dnrobotics11
08-03-2010, 20:05
Hi everyone,

I have a quick question about the C++ code for spike relays. What are the two arguments in the phrase "relay(x, y)" when I am initializing the relay in the code? One of them is clearly the relay port but what is the other and what is the order of them? Thanks a lot.

byteit101
08-03-2010, 20:45
you only need one if you are using slot 4 (default)
if you are not in slot 4, the first is the slot (if it is not 4, it's probably 6), the second is the relay port (on the DSC)
if you have it in 4, use relay(relayPort)

mikets
08-03-2010, 21:31
There are two possible constructors for the Relay class (from relay.h). Here are their definitions:

Relay(UINT32 channel, Direction direction = kBothDirections);
Relay(UINT32 slot, UINT32 channel, Direction direction = kBothDirections);
You can find the header files in c:\windriver\vxworks-6.3\target\h\wpilib.

dnrobotics11
08-03-2010, 23:03
thanks so much guys