Go to Post Don't like the predictions? Go out there and prove me wrong! - Looking Forward [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 15-02-2015, 12:27
Potatoes's Avatar
Potatoes Potatoes is offline
Registered User
AKA: Eric Wittmann
FRC #5136 (Mecha Pirates)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Santa Ynez, CA
Posts: 17
Potatoes is an unknown quantity at this point
Button 9?

We are using an Xbox 360 controller. We are trying to open a solenoid when the left stick is pressed down, close it when the right stick is pressed. The driver station reads Left Stick as button 8, Right Stick as button 9 (buttons start at 0). However, in LabView the joystick button unbundle only goes to button 8, as shown below. Expanding the bundle just shows me more "Button[8]"s, which all read the same value (Left Stick). My question is, how can I get it to read the Right Stick (button 9) input?
Attached Images
File Type: bmp button 9.bmp (130.2 KB, 37 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 15-02-2015, 12:48
HostileGato HostileGato is offline
Registered User
FRC #4005
 
Join Date: Feb 2015
Location: Fort Gibson
Posts: 3
HostileGato is an unknown quantity at this point
Re: Button 9?

I am a new programmer but I have think I have a solution to your problem. Replace the button cluster with an index array instead and label it with numeric constants you want such as nine. Team 358 has some great examples on what this would look like. http://www.team358.org/files/program...view/index.php
Reply With Quote
  #3   Spotlight this post!  
Unread 15-02-2015, 12:51
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Button 9?

Or right click on the node that converts from array to cluster, select the Cluster Size... item, and in the little dialog, enter 12, or however many buttons your controller has. Notice that it defaults to eight and was causing the limit of the buttons.

Index Array has no such limit since its size is determined at runtime and not compile time.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 15-02-2015, 12:51
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Button 9?

right-click on the Array To Cluster and choose Cluster Size to increase the number of buttons.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #5   Spotlight this post!  
Unread 15-02-2015, 14:07
Potatoes's Avatar
Potatoes Potatoes is offline
Registered User
AKA: Eric Wittmann
FRC #5136 (Mecha Pirates)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Santa Ynez, CA
Posts: 17
Potatoes is an unknown quantity at this point
Re: Button 9?

It worked! Awesome, thank you!
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 03:55.

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