Go to Post A good defense can defend against a good defense. - Squeakypig [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 09-06-2013, 11:11
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 987
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: commands activated by trigger, how?

Quote:
Originally Posted by otherguy View Post
I don't think the getTrigger() method does what you are hoping it does.
If you take a look at the javadoc for the Joystick class, then look at the getTrigger() method, you'll see that it doesn't return a boolean value.

The triggers on the logitech (and xbox if I remember correctly) are on axis 3.
The getTrigger method does return a boolean. The trigger on the Logitech Attack 3 Joystick is button 1.

To use the trigger treat it exactly like a button.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-06-2013, 11:19
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: commands activated by trigger, how?

Quote:
Originally Posted by RufflesRidge View Post
The getTrigger method does return a boolean. The trigger on the Logitech Attack 3 Joystick is button 1.

To use the trigger treat it exactly like a button.
You're right, I was thinking about the the Logitech F310... and I apparently can't read the javdoc I linked lol.

Well what I posted earlier is applicable to using using axes as buttons if anyone needs that lol.
__________________
http://team2168.org
Reply With Quote
  #3   Spotlight this post!  
Unread 09-06-2013, 11:29
cad321 cad321 is online now
Jack of all trades, Master of none
AKA: Brian Wagg
FRC #2386 (Trojans)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Burlington, Ontario
Posts: 319
cad321 is just really nicecad321 is just really nicecad321 is just really nicecad321 is just really nice
Re: commands activated by trigger, how?

Quote:
Originally Posted by RufflesRidge View Post
The getTrigger method does return a boolean. The trigger on the Logitech Attack 3 Joystick is button 1.

To use the trigger treat it exactly like a button.
Thank you very much! I couldn't find anything saying it was actually just button 1 and didn't realize that in all the documentation that button one was never listed(just trigger).
Reply With Quote
  #4   Spotlight this post!  
Unread 09-06-2013, 13:14
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 987
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: commands activated by trigger, how?

Quote:
Originally Posted by cad321 View Post
Thank you very much! I couldn't find anything saying it was actually just button 1 and didn't realize that in all the documentation that button one was never listed(just trigger).
The first step I would recommend when using any USB input device for FRC is to document the button and axis mapping and ranges. The easiest way to do this is to (on Windows 7, XP may or may not vary slightly):
  1. Click the Start Menu
  2. In the run box type "joy.cpl" and press Enter
  3. Select the desired device from the list and click Properties
  4. Select the Test tab if it is not selected already
The X axis (horizontal) and Y axis (vertical) are represented by the crosshair in the box. Axes 3-6 are represented in order, top to bottom, by bars to the right of the box. The buttons are represented below and light up when pressed. The first 6 axes (including X/Y) and 12 buttons will be transmitted, if your device has more they will be ignored.
Reply With Quote
  #5   Spotlight this post!  
Unread 10-08-2013, 17:52
alexhenning alexhenning is offline
WPILib Developer
FRC #0348
 
Join Date: Apr 2010
Rookie Year: 2003
Location: MA
Posts: 49
alexhenning will become famous soon enough
Re: commands activated by trigger, how?

There is online documentation for CommandBased programming, in particular this link shows how to attach commands to a joystick.

Code:
Joystick DriveStick = new Joystick(1);
Button button = new JoystickButton(joystick, BUTTON_NUMBER);
public OI() {
    button.whenPressed(new LauncherSpinWheels());
    // ...
}
Replace BUTTON_NUMBER with the button you want to run the command.

In addition to the online documentation, you might find these videos helpful if you're having trouble understanding CommandBasedProgram.:
CommandBased Programming with RobotBuilder: http://www.youtube.com/watch?v=k7PaY...lgn vhGObeKzp
CommandBased Programming without RobotBuilder: http://www.youtube.com/watch?v=v0vt9yKLxUQ
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


All times are GMT -5. The time now is 22:58.

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