Go to Post I keep on accidently seeing (and pronouncing) it as Chef Deli. - JJG13 [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 08-02-2015, 22:48
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Help Coding a "Creep Mode"

Does "Button 9" mean the ninth button counting from 1, or counting from zero? Don't forget that the first button is at array index 0, so the ninth button is actually at index 8. You can set a probe on the Buttons array to verify which one you need to be reading.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2015, 07:42
apm4242 apm4242 is offline
Registered User
FRC #4242
 
Join Date: Jan 2013
Location: United States
Posts: 83
apm4242 has much to be proud ofapm4242 has much to be proud ofapm4242 has much to be proud ofapm4242 has much to be proud ofapm4242 has much to be proud ofapm4242 has much to be proud ofapm4242 has much to be proud ofapm4242 has much to be proud ofapm4242 has much to be proud ofapm4242 has much to be proud of
Re: Help Coding a "Creep Mode"

Quote:
Originally Posted by Alan Anderson View Post
Does "Button 9" mean the ninth button counting from 1, or counting from zero? Don't forget that the first button is at array index 0, so the ninth button is actually at index 8. You can set a probe on the Buttons array to verify which one you need to be reading.
Thanks for the quick reply! I used the mapping that's been floating around CD: http://www.chiefdelphi.com/forums/sh...73&postcount=2

However, now I found a map saying the left joystick is button 8, not 9... Odd that it's from the same source.



The 9th light comes on in the dashboard when I press it but I'll go back to the simulator and try button 8. Is there anything wrong with the code?

Last edited by apm4242 : 09-02-2015 at 07:46. Reason: New stuff has come to light, man
Reply With Quote
  #3   Spotlight this post!  
Unread 09-02-2015, 08:26
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Help Coding a "Creep Mode"

Quote:
Originally Posted by apm4242 View Post
However, now I found a map saying the left joystick is button 8, not 9... Odd that it's from the same source.
During the Beta Test, there was a strong preference among the Java and C++ teams for the button numbers in the code to match the labels on the joysticks/gamepads. The LabVIEW functions stayed with the zero-based arrays. It's a little confusing if you're moving between programming environments.

You do want the ninth button. But its value is in array index 8, because the first button is in index 0.
Reply With Quote
  #4   Spotlight this post!  
Unread 09-02-2015, 10:08
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,795
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: Help Coding a "Creep Mode"

Quote:
Originally Posted by apm4242 View Post
Thanks for the quick reply! I used the mapping that's been floating around CD: http://www.chiefdelphi.com/forums/sh...73&postcount=2
That post is from 2013 and applied to the cRIO and pre-2015 code. The xbox mapping has changed with the 2015 control system.

Aside from that your code looks fine once you change the index from a 9 to an 8.
Just make sure, depending on your drive train, that the rotate is still getting enough power to act against any wheel scrub at low power.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 09-02-2015 at 10:49.
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:25.

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