Go to Post Just get a nice big box of maraschino cherries and a cup of coffee and settle yourself down for a fun read. You'll be amazed at the ideas that you are going to have pop into your head. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
Team 51   CD-Events   CD-Media   CD-Swap   CD-Spy   FRC-Spy   Unsung FIRST Heroes   WFA
portal register members calendar search Today's Posts Mark Forums Read FAQ rules
VEXpro
The Chief Delphi Forums are sponsored by Innovation First International, Inc.
Tormach
ADVERTISEMENT

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-03-2009, 01:28 PM
pyr0b0y pyr0b0y is offline
Programmer/Electrical
AKA: Josh
FRC #0253 (Mills Robotics Team)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2004
Location: Millbrae
Posts: 78
pyr0b0y is an unknown quantity at this point
Send a message via AIM to pyr0b0y
Button Programming Error?

I'm trying to rewrite the code for our robot in Labview, but I'm not exactly if the code I wrote will deply correctly. I want to use buttons 1 and 2 from both joysticks....were using tank drive...i think its correct, but i just want to double check....thanks!
Attached Files
File Type: vi Basic Robot Main.vi (63.3 KB, 81 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 04-03-2009, 01:47 PM
Cuse's Avatar
Cuse Cuse is offline
Registered User
AKA: Matt Mancuso
FRC #0175 (Buzz Robotics)
Team Role: Alumni
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Enfield, CT
Posts: 22
Cuse is an unknown quantity at this point
Re: Button Programming Error?

Rather than opening the motors repeatedly for each case, I would instead have a single Open Motor for each outside of the loop and a single Set Speed for each within the loop, and simply have the speed values as the case selects.

Instead of doing 2 seperate cases structures for identical motors, also just use an Or operator on the selector input for the button inputs.
Attached Files
File Type: vi Basic Robot Main.vi (52.3 KB, 73 views)
__________________


Last edited by Cuse : 04-03-2009 at 01:53 PM. Reason: Added modified VI
Reply With Quote
  #3   Spotlight this post!  
Unread 04-03-2009, 05:03 PM
pyr0b0y pyr0b0y is offline
Programmer/Electrical
AKA: Josh
FRC #0253 (Mills Robotics Team)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2004
Location: Millbrae
Posts: 78
pyr0b0y is an unknown quantity at this point
Send a message via AIM to pyr0b0y
Re: Button Programming Error?

with the "or" statement that got put in, wont that tell the program that when either Button1(x) or Button2(y), they both do the same function?
What I'm trying to ask is how does the program tell the difference...is x always "true" and y always "false"?

thanks
Reply With Quote
  #4   Spotlight this post!  
Unread 04-03-2009, 07:49 PM
Cuse's Avatar
Cuse Cuse is offline
Registered User
AKA: Matt Mancuso
FRC #0175 (Buzz Robotics)
Team Role: Alumni
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Enfield, CT
Posts: 22
Cuse is an unknown quantity at this point
Re: Button Programming Error?

Oh, my apologies, I misread the original code, I thought both motors were set to 1 for all button cases.

Code has been modified, hopefully this works out for you.
Attached Files
File Type: vi Basic Robot Main.vi (53.6 KB, 66 views)
__________________

Reply With Quote
  #5   Spotlight this post!  
Unread 04-06-2009, 04:08 PM
pyr0b0y pyr0b0y is offline
Programmer/Electrical
AKA: Josh
FRC #0253 (Mills Robotics Team)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2004
Location: Millbrae
Posts: 78
pyr0b0y is an unknown quantity at this point
Send a message via AIM to pyr0b0y
Re: Button Programming Error?

how would i go about changing this code to use digital input buttons instead of the joystick buttons? do you use dig in and arrays?
Reply With Quote
  #6   Spotlight this post!  
Unread 04-06-2009, 04:18 PM
Cuse's Avatar
Cuse Cuse is offline
Registered User
AKA: Matt Mancuso
FRC #0175 (Buzz Robotics)
Team Role: Alumni
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Enfield, CT
Posts: 22
Cuse is an unknown quantity at this point
Re: Button Programming Error?

You would use a GetDigIn VI, convert the array to a cluster, and then use whichever inputs you'd like for your cases.
Attached Files
File Type: vi Basic Robot Main.vi (52.6 KB, 72 views)
__________________

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
Button Programming: Is this right? greatman05 NI LabVIEW 12 02-13-2009 03:02 PM
Programming a joystick button... programmr Programming 2 01-05-2009 03:13 PM
button programming joesmomh00haha Programming 12 02-10-2007 09:36 AM
Joystick Button programming Bharat Nain Programming 5 02-18-2005 10:48 AM
Arm Rotation (1 Button Programming!!) Joelster Technical Discussion 1 02-14-2002 12:15 PM


All times are GMT -5. The time now is 09:54 PM.

The Chief Delphi Forums are sponsored by Innovation First, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © Delphi and Pontiac Central High School