Quote:
Originally Posted by nickb705
After talking to my mentor, I had miss understood the intent of the limit switch, we DO want to want to have the motor run as long as the button is held, or the limit switch is hit, whichever comes first. I have figured out how to run the motor (up with button 1 and down with button 2) I could just use some help figuring out how to incorporate the two limit switches to turn the motor off. Any example would be highly appreciated!
|
Here's a strong hint: use a boolean AND function to combine the "up" button value with the "top" limit switch value, so that the result is true only when the button is pressed and the limit switch is not activated. Do the same thing with the "down" button and "bottom" switch.
Now you have two boolean values, one saying "move up" and the other saying "move down". If you can't figure out how to use those values to control your lift motor, ask for more help.