Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Relay Code (http://www.chiefdelphi.com/forums/showthread.php?t=84040)

dnrobotics11 08-03-2010 20:05

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.

byteit101 08-03-2010 20:45

Re: Relay Code
 
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

Re: Relay Code
 
There are two possible constructors for the Relay class (from relay.h). Here are their definitions:
Code:

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

Re: Relay Code
 
thanks so much guys


All times are GMT -5. The time now is 13:46.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi