Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   How To program the second joystick? (http://www.chiefdelphi.com/forums/showthread.php?t=84168)

cardozo 11-03-2010 14:38

How To program the second joystick?
 
Hey everyone!!! Im from team 2121,
originally, we have only one joystick to do both drive and activate the pneumatic kicker. However, that has made the job more difficult because the driver sometimes can not concentrate on driving.
So we decide to use the 2nd joystick for the pneumatic kicker.
This is how I start

Open.vi: joystick open (joy device - usp2) --> refnum registry set (refum name - joystick 2)

Teleop vi: refum registry get( refum name - joystick 2) --> joy get --> button 1

Finish vi: refum registry get ( refum name - joystick 2) --> joy close

However, it doesnt work. the robot doesnt respond when I press the trigger.
Please let me know if there is anything wrong with this code. Thank you

Team 2121:(

krudeboy51 11-03-2010 15:46

Re: How To program the second joystick?
 
It depends on what are you using to program, but in c++ our code is :

class: public
{
JoyStick *RightStick, *LeftStick;
}

Public:
{
RightStick = new Joystick (1);
LeftStick = new Joystick (2);
}

and to program the trigger:

if (LeftStick or RightStick-> GetTrigger())
Device->Set()

(if this is any help for you ok!)

Brandon_L 11-03-2010 16:46

Re: How To program the second joystick?
 
Can you post a picture of whats in your teleop?

From what you said, things to check would be:
Make sure your ref names match EXATCLY (Spaces, periods, and so on..)
Im pretty sure that device index starts at 0. Your first joystick should be 0, 2nd should be 1.
Open up your dashboard, and go to one of the tabs that list joysticks. Make sure the one you want to be your second is right below your first (it switched up on me and drove me crazy for an hour)

EricWilliams 12-03-2010 08:43

Re: How To program the second joystick?
 
Quote:

Originally Posted by cardozo (Post 935689)
Hey everyone!!! Im from team 2121,
originally, we have only one joystick to do both drive and activate the pneumatic kicker. However, that has made the job more difficult because the driver sometimes can not concentrate on driving.
So we decide to use the 2nd joystick for the pneumatic kicker.
This is how I start

Open.vi: joystick open (joy device - usp2) --> refnum registry set (refum name - joystick 2)

Teleop vi: refum registry get( refum name - joystick 2) --> joy get --> button 1

Finish vi: refum registry get ( refum name - joystick 2) --> joy close

However, it doesnt work. the robot doesnt respond when I press the trigger.
Please let me know if there is anything wrong with this code. Thank you

Team 2121:(

We've also had this exact same problem, with no solution. I'd be interested if anyone has any other ideas. Even reinstalling Labview didn't help.


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

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