View Single Post
  #2   Spotlight this post!  
Unread 01-10-2009, 03:10 PM
Eric Finn's Avatar
Eric Finn Eric Finn is offline
Registered User
FRC #0166 (Chop Shop)
Team Role: College Student
 
Join Date: May 2006
Rookie Year: 2005
Location: Merrimack, NH
Posts: 101
Eric Finn has a spectacular aura aboutEric Finn has a spectacular aura about
Send a message via AIM to Eric Finn
Re: Programming a relay in C++

In this season's code, you would do the following:

Code:
Relay myRelay([slot],[chanel],kBothDirections); //initialize the relay in slot [slot], channel [channel], and allow it to move both directions
myRelay.Set(kForward); //turn the relay on in the forward direction
myRelay.Set(kOff); //turn the relay off
Value and Direction are enumerated in Relay.h in WPILib. Be aware that you cannot Set the Relay as kOn if you use kBothDirections as the third parameter to the Relay constructor.

If this isn't enough detail, just say so.
__________________
It always takes longer than you expect, even when you take into account Hofstadter's Law.
--Hofstadter's Law

Reply With Quote