View Single Post
  #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