View Single Post
  #3   Spotlight this post!  
Unread 03-02-2012, 11:15
eddie12390's Avatar
eddie12390 eddie12390 is offline
Registered User
AKA: Eddie
FRC #3260 (SHARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Pittsburgh
Posts: 285
eddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of light
Re: Using Command base system

Quote:
Originally Posted by RufflesRidge View Post
It sounds like you're looking for the classes in wpilibj.buttons
Code:
Button js1_button1 = new JoystickButton(js1, 1); // Create a Joystick Button, arguments sent to the constructor are (stickObject, button number)

js1_button1.whileHeld(new CommandHere()); or js1_button1.whenPressed(new CommandHere()); // buttonObject.whileHeld, whenPressed, or whenReleased (new Command Name());
Reply With Quote