Go to Post By the way, a piece of advice to all those who haven't gone to Manchester for Kickoff before: Go. It's something you have to do at least once in your time in FIRST. - Billfred [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 15-08-2015, 14:08
Howard Wang Howard Wang is offline
Registered User
FRC #1671
 
Join Date: Jul 2015
Location: California
Posts: 7
Howard Wang is an unknown quantity at this point
Joystick issue

Hi,

I'm relatively new to command based programming. I have code on Netbeans for our team's robot from last year, so it uses the 2014 control system.

I have the 2015 driver station and I change it to the '14 DS & FMS so I have comms and robot code.

When I plug in a controller (Xbox), the Joysticks box turns green and if I go to the USB devices on the DS, the lights will show up corresponding to the buttons that I press on the Joystick (e.g. 1-A, 2-B, etc).

However, when I enable teleop and press buttons, the robot does not respond even though I have specific buttons perform commands. I have already printed out the joystick and button values (-1.0 to 1.0 for joysticks and true/false for buttons) and the joystick values are always 0.0 and the button values are always false, even though I'm pressing them.

I don't think it's a code error because I went over it with one of our team's mentors.

Any help is appreciated

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 15-08-2015, 16:14
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is offline
Founder and CEO, DeadMemes Studios
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 370
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Re: Joystick issue

Quote:
Originally Posted by Howard Wang View Post
Hi,

I'm relatively new to command based programming. I have code on Netbeans for our team's robot from last year, so it uses the 2014 control system.

I have the 2015 driver station and I change it to the '14 DS & FMS so I have comms and robot code.

When I plug in a controller (Xbox), the Joysticks box turns green and if I go to the USB devices on the DS, the lights will show up corresponding to the buttons that I press on the Joystick (e.g. 1-A, 2-B, etc).

However, when I enable teleop and press buttons, the robot does not respond even though I have specific buttons perform commands. I have already printed out the joystick and button values (-1.0 to 1.0 for joysticks and true/false for buttons) and the joystick values are always 0.0 and the button values are always false, even though I'm pressing them.

I don't think it's a code error because I went over it with one of our team's mentors.

Any help is appreciated

Thanks
If you are running a 2014 robot with the 2015 DS, the port you assign the joystick to in the DS settings menu needs to be one less than what you assign it in the code.

For example, if you have:

Code:
Joystick driveStick = new Joystick(1);
You need to assign the Joystick to port 0 in the DS settings menu to read that controller in the code.

I had the same issue and solved it here.
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder


Reply With Quote
  #3   Spotlight this post!  
Unread 15-08-2015, 19:20
Howard Wang Howard Wang is offline
Registered User
FRC #1671
 
Join Date: Jul 2015
Location: California
Posts: 7
Howard Wang is an unknown quantity at this point
Re: Joystick issue

Thanks Mitchel Stokes it helped
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 10:22.

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