Go to Post Does FIRST know about some rare inverted mushroom that I do not? - sanddrag [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-01-2009, 16:07
Parthenon Parthenon is offline
Registered User
FRC #1325 (Inverse Paradox)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2004
Location: Mississauga
Posts: 10
Parthenon is an unknown quantity at this point
How to control relays

I have gotten to a point where I need to control relays, however, I cannot find documentation in the C++/C Programming guide on how to do so. To my understanding, in order to make the relay move the forward, you would have to use relay1.Set(relay1.kForward); I try this, but it doesnt move forward =(
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2009, 16:58
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: How to control relays

You should be able to do it like this:

Code:
relay1.Set(Relay::kForward);
To later turn it off:

Code:
relay1.Set(Relay::kOff);
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2009, 17:09
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: How to control relays

Quote:
Originally Posted by Parthenon View Post
relay1.Set(relay1.kForward);
Try
Code:
relay1.Set(Relay::kForward);
instead. The thing before the double colon :: and the kForward constant isn't an object. It's a "namespace", in this case saying you want to use the named constant from the group of things associated with the Relay class.
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2009, 16:23
Maxpower57's Avatar
Maxpower57 Maxpower57 is offline
Fabuloso
AKA: Maxwell V.
FRC #2574 (RoboHuskie)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: St. Anthony, MN
Posts: 53
Maxpower57 will become famous soon enoughMaxpower57 will become famous soon enough
Send a message via AIM to Maxpower57
Re: How to control relays

if the relay is a *pointer then you'd use this
Code:
relay1->Set(Relay::kReverse);
__________________
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Control System How To Al Skierkiewicz Electrical 31 05-11-2008 22:28
Spike Relays...How Come they are not in the Inventor files D_Price Technical Discussion 2 28-01-2008 09:20
How did you control your Robot? 1? 2? Wheel? How? ChrisCook Control System 9 17-05-2005 21:41
How to control piston? Goaliexam Control System 2 07-02-2005 17:20
How do you control relays BinaryBob0001 Technical Discussion 2 21-01-2002 08:42


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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