Go to Post Now stop reading CD, do your homework, eat your peas, brush your teeth, and go to bed. Any time you spend speculating as to what Dave's ravings might mean is completely wasted. - Richard Wallace [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 24-01-2017, 14:13
JeffB JeffB is online now
Registered User
FRC #5052 (RoboLobos)
Team Role: Mentor
 
Join Date: Apr 2015
Rookie Year: 2014
Location: Austin
Posts: 64
JeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to behold
Re: Tank Drive Talon SRX

I'm going to walk through the entire joystick process hoping this gets you, and others, on the right path.

The first thing you want to do is plug in your joysticks. Once they're plugged in, open up your Driver Station and click on the 4th tab down. It looks like the USB icon and is right above the lightning bolt, just below the gear.

This will give you a list of devices under USB order. They'll all have a number next to them. Pay attention to these numbers.

On one of your joysticks, move it forward. Do you see any axis change? If not, click on another joystick in the list and repeat until you see an axis move. Once you see the axis move, you've identified which number matches that specific joystick.

Take a look at all of the things that populate now. You have booleans and some axis values. You can move your joystick around to find where each axis is as well as push each button to see which responds. Both the axis and booleans are 0-indexed. That means the first axis is 0, the second is 1, and so on. While you're coding, you'll want to have a map of these index values to the buttons they match.

Once you've done this for all of your joysticks, open up the Begin.vi. Open a reference to each joystick using the USB number we just found matching the joystick. Give your joystick a meaningful name. The default project has "Joystick 0" Please don't use this naming scheme for yours. Replace that with something meaningful. "Drive joystick" "Left side joystick" Use a name that describes what it is. Match the code in the Begin.vi to create a reference.

In your teleop code, get the joystick reference using the name you just created.

From here, you can pull out the button or axis values and index the array of values using the index we found testing in the driver station. Pass the desired axis/boolean to your logic to see what happens.
__________________
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:56.

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