How to use the same input to start and stop?
Posted: Mon Jun 21, 2021 6:37 am
I’m using a MCP233 to open/close a car scissor door via a momentary rocker switch. One position will open the door and the other position will close it. Pressing either while the door is in motion will stop the door. This type of control logic is also used for car windows, garage door openers, etc.
I can use a max action to stop the motor. However, the desired logic depends on the state of the motor. When I've done this type of thing before I've used an interrupt and placed the logic there - a simple if/else clause. It seems like the actions are basically interrupts that you can only hardwire to one of a set of operations. I considered monitoring the input in the script, but I can’t figure out how to do that. Please advise.
I can use a max action to stop the motor. However, the desired logic depends on the state of the motor. When I've done this type of thing before I've used an interrupt and placed the logic there - a simple if/else clause. It seems like the actions are basically interrupts that you can only hardwire to one of a set of operations. I considered monitoring the input in the script, but I can’t figure out how to do that. Please advise.