Relay Code

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.

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)

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 arget\h\wpilib.

thanks so much guys