Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   programming a motor to two buttons (http://www.chiefdelphi.com/forums/showthread.php?t=73112)

solomason519 28-01-2009 11:31

programming a motor to two buttons
 
1 Attachment(s)
hey im new to chief del phi as well as to programming. I have configured a program to run a motor on button six on the attack controller. however i dont know how program buttton seven to reverse the same motor. help please.....:(

In my second while loop is where my window motor is i already have it programmed to button six but i want it to be programed to button six and reverse by button seven....

Kevin Sevcik 28-01-2009 12:24

Re: programming a motor to two buttons
 
1 Attachment(s)
That's... an interesting way of turning a motor on and off with a button. A slightly cleaner and more expandable way is to use the Select function block (in the Programming>Comparison palette), or a set of Case Structures. The Select function block has one boolean input (green wire) and two other inputs that can be of many different types. It selects which of these two other inputs to pass to the output based on whether the boolean is true or false. I've put together the motor control you were looking for in the picture below using some select blocks. This particular wiring forces the forward button to override the reverse button. So if you have both buttons pressed, the motor will move forwards.

solomason519 28-01-2009 12:37

Re: programming a motor to two buttons
 
Thanks you so much kevin. You have helped me get to where i needed to be.....:)


All times are GMT -5. The time now is 02:21.

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