View Full Version : programming a motor to two buttons
solomason519
28-01-2009, 11:31
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
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
Thanks you so much kevin. You have helped me get to where i needed to be.....:)
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.