Go to Post Maybe it's the guy who doesn't stop drawing in his notebook in class, or the girl who writes the best essays in English. What team can't use their skills? - KathieK [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 03-03-2011, 22:42
de_ de_ is offline
Registered User
AKA: Dave Edwards
FRC #1310 (Runnymede Robotics)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Toronto, Ontario
Posts: 256
de_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the rough
WPI Lib Relay class - individual line control

I can't quite figure out the WPI Lib description as to whether we can individually control each of the 2 output lines without effecting the other line. Here's an extreme example

On one line have an (12v) Red LED connected and be able to turn it on and off without effecting the state of what is on the other line of the spike. On the other line, we want to have a white 12v led that we flash in software, again, not effecting the Red LED.

The class description seems to hint that we need to declare 2 relays on the SAME channel,
- one with forward only (line 1) control
Relay m_relay1(1, Relay::KForwardOnly);
- and one with reverse only (line 2).
Relay m_relay2(1, RElay::kReverseOnly);

And then we can control each line relay individually.

Or do you declare a single relay and change the direction to access a specific line on the fly like

Relay m_relay(1);

:
m_relay.SetDirection(Relay::kForwardOnly); // access 1 line of the spike
m_relay.Set(Relay::kOn) ; // set On or Off 1st line
m_relay.SetDirection(Relay::kReverseOnly); // access 2nd line
m_relay.Set(Relay::kOn); // set On or Off 2nd line....
:

Sorry last coding I did was on an RC
Reply With Quote
 


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


All times are GMT -5. The time now is 11:12.

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