Hi @echigard,
Then you have a motor with 3 states : running CW, stopped and running CCW
You would probably want to rember the last direction your motor was running before it was stopped. (last running state)
The sensor changes the state of the motor's state as:
- if the state is (runningCW or running CCW) then {last running state = motor's state; motor's state = stopped}
- else: the motor's state is the last running state.
button1 state falling -> motor state : running CW
button2 state falling -> motor state : running CCW
Jacques