Go to Post Reffing a FIRST event is unlike being an ump or a ref at any other event. Where else is a game invented each year and over 1000 teams play this game within 3 months of its birth? - Andy Baker [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 16-02-2013, 12:51
Negative 9 Negative 9 is offline
Registered User
FRC #0611
 
Join Date: Dec 2012
Location: Mclean, VA
Posts: 46
Negative 9 is an unknown quantity at this point
Using Spike Relays in Java?

Can anyone explain to me the best way to use Relays in code? The API confuses me. There are several ways to construct the relays and set them to values and I'm having trouble understanding the differences between them.

I'm trying to use a relay to control a window motor so from what I can tell I am supposed to construct the relay like this:

Code:
relay = new Relay(1, Relay.Direction.kBoth);
and I'm supposed to control the Relay by doing something like this:

Code:
if(joyRight.getRawButton(4)) {
	relay.set(Relay.Value.kON);
	relay.set(Relay.Direction.kForward);
} else if(joyRight.getRawButton(5)) {
	relay.set(Relay.Value.kON);
	relay.set(Relay.Direction.kReverse);
} else {
	relay.set(Relay.Value.kOff);
}
If that's all good then the other possibility is that it's wired incorrectly. Does anyone know which section of the DigitalSidecar the triple wire is supposed to be plugged in? The diagnostic light on the Relay is a solid yellow-orange color which I assume mean that it's been initialized but isn't receiving any signals.

Any and all help is appreciated!
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 10:13.

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