Go to Post It is very difficult for a large, inexperienced, impatient group to create order from chaos. - Wayne TenBrink [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 11-01-2012, 17:33
sebflippers sebflippers is offline
Registered User
FRC #2914
 
Join Date: Jan 2012
Location: dc
Posts: 56
sebflippers will become famous soon enoughsebflippers will become famous soon enough
How to use a Joystick

Correct me if I am mistaken, but we no longer use the blue driver station. Nowadays everything goes through the classmate. If I understood that correctly I need help creating a Joystick object. On the blue box you would say that the joystick on the 1st usb port will be the left one and 2nd will be the right. How do you tell it where to look for the joystick now?

Joystick stickLeft = new Joystick(????????);
Reply With Quote
  #2   Spotlight this post!  
Unread 11-01-2012, 18:07
Djur's Avatar
Djur Djur is offline
WPILib
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Massachusetts
Posts: 182
Djur will become famous soon enough
Re: How to use a Joystick

Joystick j = new Joystick(final int usbPort);

usbPort is the USB slot the joystick is plugged into on the laptop you're using.
__________________
WPILib dev (RobotBuilder, SmartDashboard, GRIP)
Reply With Quote
  #3   Spotlight this post!  
Unread 11-01-2012, 18:11
pudgeball pudgeball is offline
Registered User
AKA: Nick McGuire
FRC #2386 (BCHS Trojan Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Ontario
Posts: 13
pudgeball is an unknown quantity at this point
Re: How to use a Joystick

You are correct, now we use the classmate as the driver station however not much has changed. To create a joystick object you still would write;

Joystick driveStick = new Joystick(x); //where x is where the joystick is plugged in

And to check which is which, there is a tab (which I'm blanking on the name) on the driver station that allows to you see the currently plugged in joysticks and re-arrange the order of the joysticks.
Reply With Quote
  #4   Spotlight this post!  
Unread 11-01-2012, 18:23
sebflippers sebflippers is offline
Registered User
FRC #2914
 
Join Date: Jan 2012
Location: dc
Posts: 56
sebflippers will become famous soon enoughsebflippers will become famous soon enough
Re: How to use a Joystick

Thanks. That's what I needed. just so that I know: which is port 1 and which is port 2 by default, and do these defaults get restored upon every boot or will it remember my settings when I tell it which port is which?
Reply With Quote
  #5   Spotlight this post!  
Unread 11-01-2012, 18:31
pudgeball pudgeball is offline
Registered User
AKA: Nick McGuire
FRC #2386 (BCHS Trojan Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Ontario
Posts: 13
pudgeball is an unknown quantity at this point
Re: How to use a Joystick

From my experience the Joysticks will stay the same, so I don't believe it will restore.
Reply With Quote
  #6   Spotlight this post!  
Unread 13-01-2012, 13:08
gixxy's Avatar
gixxy gixxy is offline
Programming and Arduino Mentor
AKA: Gustave Michel III
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Ruston, LA
Posts: 207
gixxy is on a distinguished road
Re: How to use a Joystick

no matter which usb ports you plug the joysticks into (or even though a hub) they will show up as usb 1, 2, 3, ect depending on the number of joysticks. You do not need to worry about have joysticks on ports 1 and 3 by default.
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 00:40.

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