Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Action on button press and release (http://www.chiefdelphi.com/forums/showthread.php?t=92005)

M-Ross 16-02-2011 13:26

Action on button press and release
 
We would like to have a motor run one direction on a button press and the opposite direction on release. How does one program this? Thanks.

Vikesrock 16-02-2011 13:43

Re: Action on button press and release
 
So you want it to run one way the whole time when the button is being held and the other way the whole time the button is not held?

If that's what you want try the "Select" node. It's in the Comparisons palette I believe, and it will select the top input and pass it through if the middle input is true and the bottom input if the middle input is false. You would put the button as the middle input and your desired motor speeds as the top and bottom.

If you want to run the motor in a certain direction for a certain period of time on button press and release that becomes a little bit trickier.

M-Ross 16-02-2011 14:59

Re: Action on button press and release
 
Is it possible to have a singular motor subject to the control of more than one button? Like, could the press of one button turn it one direction and the press of another turn it the other way? If so, how is that done?

Wolfgang 16-02-2011 16:35

Re: Action on button press and release
 
Yes, you need a case structure with 3 cases: case 0 with nothing, case 1 with forward motor, and case 2 with a backwards motor.

You merge the signal of the two buttons using a boolean array. Then you convert the boolean array value to a number using something in the boolean palette.

Vikesrock 16-02-2011 20:04

Re: Action on button press and release
 
1 Attachment(s)
Quote:

Originally Posted by M-Ross (Post 1024450)
Is it possible to have a singular motor subject to the control of more than one button? Like, could the press of one button turn it one direction and the press of another turn it the other way? If so, how is that done?

Yes, this can be done. The way Mehmed posted is one option. I have attached a picture of another way you can do it.

M-Ross 16-02-2011 20:38

Re: Action on button press and release
 
You guys are the best!

We'll give these a try and see what happens. Thanks!


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

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