Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Button Programming Error? (http://www.chiefdelphi.com/forums/showthread.php?t=76475)

pyr0b0y 03-04-2009 14:28

Button Programming Error?
 
1 Attachment(s)
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!

Cuse 03-04-2009 14:47

Re: Button Programming Error?
 
1 Attachment(s)
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.

pyr0b0y 03-04-2009 18:03

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

Cuse 03-04-2009 20:49

Re: Button Programming Error?
 
1 Attachment(s)
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.

pyr0b0y 06-04-2009 17:08

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?

Cuse 06-04-2009 17:18

Re: Button Programming Error?
 
1 Attachment(s)
You would use a GetDigIn VI, convert the array to a cluster, and then use whichever inputs you'd like for your cases.


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi