Go to Post As they say... I'd rather be lucky than good any day (especially Saturdays). :) - JVN [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-02-2010, 14:33
chris janney chris janney is offline
Registered User
FRC #3266
 
Join Date: Jan 2010
Location: eaton ohio
Posts: 46
chris janney is an unknown quantity at this point
Exclamation spike relay code urgent

ok hi all
ok i am a part of our mechanical team, and our programmer isnt here. we ship in two days and our spike relay isnt programmed. can someone please show me the nessacary coding for it. if it helps we are using java.
Reply With Quote
  #2   Spotlight this post!  
Unread 21-02-2010, 17:55
Trevor_Decker's Avatar
Trevor_Decker Trevor_Decker is offline
Registered User
AKA: Trevor Decker
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: Pittsburgh
Posts: 42
Trevor_Decker is an unknown quantity at this point
Re: spike relay code urgent

Place the flowing code where your joysticks are being declared

Code:
Relay spike = new Relay(4,1);
Then put the flowing in the method teleopPeriodic()
Code:
 /*
assumes that you want the spike to turn on if the triger is pressed on a joystick named m_leftStick
*/
  if(m_leftStick.getRawButton(1)){
spike.set(Relay.Value.kForward);
}
else{
spike.set(Relay.Value.kOff);
}
__________________
- Trevor

Team 3504 - The Girls of Steel 2011 - Present
2012 Pittsburgh Regional Engineering Inspiration, and website awards
Team 1743 - The Short Circuits 2009 - 2011
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2010 Won Autodesk Animation Competition
2010,2011 Pittsburgh Team spirit award
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
spike relay problem? Maxpower57 Electrical 15 09-04-2012 19:18
Spike relay code not working wywern209 Programming 9 05-02-2010 22:04
Relay (Spike) elbuo Electrical 2 09-02-2009 20:36
Spike Relay Input nwagers Electrical 3 16-07-2002 22:23


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

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