Go to Post I've worked with space based navigation and lever arms and planes and Kalman filters. .. and I have never, ever once considered looking up to navigate. - purduephotog [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 17-01-2009, 16:14
Mikesername's Avatar
Mikesername Mikesername is offline
meh.
AKA: Mike Dame
FRC #3044 (Team 0xBE4)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ballston Spa, NY
Posts: 32
Mikesername is an unknown quantity at this point
Send a message via AIM to Mikesername
Programming Specific Button Input on Controller

Hey,
Searching didn't help much, mainly because I didn't know how to phrase the query...

But what I want to know is, how could I program a specific button input on the controller? i.e., programming the trigger to activate a motor when pressed...

I know I'm being a little vague but I don't really know how to phrase this question :\

Thanks,
Mike
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2009, 16:17
Alexa Stott's Avatar
Alexa Stott Alexa Stott is offline
All I do is twin.
AKA: elixir
FRC #0025 (Raider Robotix)
Team Role: College Student
 
Join Date: Oct 2005
Rookie Year: 2006
Location: No. Bruns., NJ/College Park, MD
Posts: 781
Alexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond repute
Send a message via AIM to Alexa Stott
Re: Programming Specific Button Input on Controller

In WindRiver, you can use joystickname.GetTrigger() and joystickname.GetTop() for the trigger and the top. You can then use joystickname.GetRawButton(button number).

Replace joystickname with the name of your joystick variable. Replace button number with the number of the button (each button is labelled by number on the kit joysticks).

GetTrigger, GetTop, and GetRawButton return true or false.
__________________
|Email:alexastott[at]gmail.com|Facebook|@zelixir|Google+|
[University of Maryland Computer Science, Psychology]
[Brunswick Eruption]
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2009, 16:19
Mikesername's Avatar
Mikesername Mikesername is offline
meh.
AKA: Mike Dame
FRC #3044 (Team 0xBE4)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ballston Spa, NY
Posts: 32
Mikesername is an unknown quantity at this point
Send a message via AIM to Mikesername
Re: Programming Specific Button Input on Controller

How about in LabView?

Thanks for the quick reply, btw
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2009, 16:22
keehun's Avatar
keehun keehun is offline
Team Captain
AKA: Keehun Nam
FRC #2502 (EP Robotics)
Team Role: Leadership
 
Join Date: May 2008
Rookie Year: 2008
Location: Eden Priaire
Posts: 474
keehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond reputekeehun has a reputation beyond repute
Send a message via AIM to keehun
Re: Programming Specific Button Input on Controller

Yes!

Now, you haven't mentioned if you use LabView or C, but for LabView this is what you would do:

Use the "Joystick -> Get" VI. It's under WPI libraries -> RobotDrive-> Joysticks -> Get

You first need to open a "channel" to that joystick. Then pass in the JoystickDevRef from the OPEN to GET

There are two outputs, one for axis and one for buttons. You need a "Unbundle" vi. It's in Programming->Clusters->Unbundle (you have two choices, by name or just by blocks)

Then you can select which button to read and it will give you a true or a false.

keehun

edit: wow you guys respond fast ;-) (while I was typing he mentioned that he used labview)
__________________
For by grace you have been saved through faith, and that not of yourselves; it is the gift of God, not of works, lest anyone should boast. -- Ephesians 2:8-9
2010: Quarter Finalist (MN 10,000 Lakes)
2010: Website Award (MN 10,000 Lakes)
2009: Quarter Finalist (MN 10,000 Lakes)
2009: GM Industrial Award (MN 10,000 Lakes)
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2009, 16:22
Alexa Stott's Avatar
Alexa Stott Alexa Stott is offline
All I do is twin.
AKA: elixir
FRC #0025 (Raider Robotix)
Team Role: College Student
 
Join Date: Oct 2005
Rookie Year: 2006
Location: No. Bruns., NJ/College Park, MD
Posts: 781
Alexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond repute
Send a message via AIM to Alexa Stott
Re: Programming Specific Button Input on Controller

Quote:
Originally Posted by Mikesername View Post
How about in LabView?

Thanks for the quick reply, btw
I have only worked for a bit in LabView, but I believe you could just use the blocks that are available in the WPILib. It has all the same functions available, but everything is a block, not actual code. You should be able to "wire" everything in LabView so that if one of the functions returns "true," it turns on the motor. If "false," it turns it off.

Sorry I cannot give more specific instructions than this. Perhaps someone who has worked more with LabView would be able to help.

Edit: keehun just posted the appropriate instructions above.
__________________
|Email:alexastott[at]gmail.com|Facebook|@zelixir|Google+|
[University of Maryland Computer Science, Psychology]
[Brunswick Eruption]
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2009, 16:37
ShotgunNinja's Avatar
ShotgunNinja ShotgunNinja is offline
Programming Mentor, FRC 4247
AKA: Nicholas Iannone
FRC #4247 (CougarBOTS)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Milwaukee, WI
Posts: 160
ShotgunNinja is a jewel in the roughShotgunNinja is a jewel in the roughShotgunNinja is a jewel in the roughShotgunNinja is a jewel in the rough
Re: Programming Specific Button Input on Controller

Also, it is possible to make a subVI that lets you select a single button output. Here's a copy of a subVI that I threw together (Sorry, haven't really tested it that much, let me know how it works!). You have to use an unsigned 16-bit int for the "index" pin, can't seem to figure out why (It says "wire enumeration conflict"). I guess speed of recursions doesn't really matter, but it's theoretically slightly faster than using the Joystick Get VI.
Attached Files
File Type: vi Joystick Get Button.vi (18.0 KB, 25 views)
__________________
Team #2970 Alum
Team #1652 Alum
2006: School Mascot for Team 1652
2007-2008: Programmer for Team 1652 (Robot Mafia)
2009: Programmer on Team 1652 (Robot Mafia), Programmer on Team 2970 (eSchool eBots)
2010-2016: Volunteer, Wisconsin Regional
2017: Programming Mentor, FRC 4247 (CougarBOTS, Obama SCTE, Milwaukee, WI)
Reply With Quote
  #7   Spotlight this post!  
Unread 17-01-2009, 17:03
Mikesername's Avatar
Mikesername Mikesername is offline
meh.
AKA: Mike Dame
FRC #3044 (Team 0xBE4)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ballston Spa, NY
Posts: 32
Mikesername is an unknown quantity at this point
Send a message via AIM to Mikesername
Re: Programming Specific Button Input on Controller

Keehun, I tried what you said and I've gotten this far:



After this, I'm confused... how do I specify button from axis..?


(btw, rookie team/freshman)

EDIT: I cleaned up the wire so I'm not opening two channels for the same USB and the joystick get just comes off of the same wire now, I was just too lazy to retake the SS, so I don't need comments on how that's messed up

Last edited by Mikesername : 17-01-2009 at 17:07.
Reply With Quote
  #8   Spotlight this post!  
Unread 17-01-2009, 17:21
TotalChaos's Avatar
TotalChaos TotalChaos is offline
Registered User
AKA: Austin
FRC #2837 (Freebird Robotics)
Team Role: College Student
 
Join Date: Apr 2008
Rookie Year: 2006
Location: Gilbert AZ
Posts: 112
TotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud of
Send a message via MSN to TotalChaos
Re: Programming Specific Button Input on Controller

Mikesername,

I think I have to solution to what you are trying to do posted in another thread. Check it out HERE.

I hope it's what you're looking for.

Good luck!

- Austin
__________________
The 39th Aero Squadron - Team 39! (Visit our website!)
Team Role: 3 Years as Driver - College Student/Mentor!


Freebird Robotics - On a 1 year hiatus! (Visit our website!)
Arizona 2009: Semifinalists! (69 and 498), Delphi "Driving Tomorrow's Technology" Award
Reply With Quote
  #9   Spotlight this post!  
Unread 17-01-2009, 17:34
Mikesername's Avatar
Mikesername Mikesername is offline
meh.
AKA: Mike Dame
FRC #3044 (Team 0xBE4)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ballston Spa, NY
Posts: 32
Mikesername is an unknown quantity at this point
Send a message via AIM to Mikesername
Re: Programming Specific Button Input on Controller

@Austin:
Thanks! Your post with diagrams really helped!

If I have any other questions about it, (which I probably will ) I'll ask.

Thanks guise.
__________________




[ ballston spa robotics | www.team3044.com | team BE4]
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
USB input controller how to. jmanela NI LabVIEW 9 15-01-2009 22:51
button programming joesmomh00haha Programming 12 10-02-2007 10:36
Programming Analog Input from 2004 Controller Danny Diaz Programming 8 30-01-2007 22:44
pic: Lightning Robotics PS2 Controller button Joe J. Extra Discussion 1 10-03-2006 17:43
Robot Controller Digital Input crazycliffy Electrical 11 16-02-2003 04:28


All times are GMT -5. The time now is 22:19.

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