Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   spike relay code urgent (http://www.chiefdelphi.com/forums/showthread.php?t=83283)

chris janney 21-02-2010 14:33

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.

Trevor_Decker 21-02-2010 17:55

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);
}



All times are GMT -5. The time now is 09:28.

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