Go to Post I guess what I am trying to say is that GP is inside all of us just waiting for a chance to escape. I am sure how the virus spread. I put the blame solely on the shoulders of Chief Delphi. - Ken Loyd [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 11-03-2010, 14:38
cardozo cardozo is offline
Registered User
FRC #2121
 
Join Date: Feb 2010
Location: Washington DC, US
Posts: 4
cardozo is an unknown quantity at this point
Unhappy 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
Reply With Quote
  #2   Spotlight this post!  
Unread 11-03-2010, 15:46
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
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!)

Last edited by krudeboy51 : 11-03-2010 at 15:48.
Reply With Quote
  #3   Spotlight this post!  
Unread 11-03-2010, 16:46
Brandon_L Brandon_L is offline
Someone told me there was food here
AKA: Brandon Liatys
FRC #2180 (Zero Gravity)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Newark, NJ
Posts: 1,200
Brandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond repute
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)
__________________
FRC 2495 - Hamilton West Robotics [2007-2014] - whats a..."hive mind"?
FRC 3929 - Atomic Dragons [2012-2013]
FRC 2180 - Zero Gravity [2017-]

Just trying to collect all the possible team colors

Last edited by Brandon_L : 11-03-2010 at 16:49.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-03-2010, 08:43
EricWilliams EricWilliams is offline
Registered User
FRC #2039 (Rockford Robotics)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2001
Location: Rockford, IL
Posts: 103
EricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of lightEricWilliams is a glorious beacon of light
Re: How To program the second joystick?

Quote:
Originally Posted by cardozo View Post
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.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you program joystick buttons in LabVIEW? darkpheonix NI LabVIEW 10 13-04-2014 10:20
How do I program a relay to turn on and off by pressing a button on the joystick? eweathers NI LabVIEW 4 28-01-2009 22:34
How to conect solenoids to the circuit board. and how to program it...??? arpitshah Pneumatics 6 13-01-2008 15:06
Does anyone have an idea on how to make a joystick program for an operating board? necroprime Programming 8 09-11-2002 19:04
Programming the second joystick in PBASIC archiver 2001 2 24-06-2002 00:25


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

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