Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Using Command base system (http://www.chiefdelphi.com/forums/showthread.php?t=101805)

Biolore 02-02-2012 18:26

Using Command base system
 
so... I'm trying to use the new command base system, so I've gone through the cookbook thing. I don't understand how to make a button on a controller link to a command. The cookbook uses a button class that isn't in the library, so how does this work?

RufflesRidge 02-02-2012 18:33

Re: Using Command base system
 
It sounds like you're looking for the classes in wpilibj.buttons

eddie12390 03-02-2012 11:15

Re: Using Command base system
 
Quote:

Originally Posted by RufflesRidge (Post 1118750)
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());



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

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