|
Re: Code Not Working Properly
The code takes the button value and compares to the last value, the value delayed by the feedback node. When different the button was either just pressed, or just released. The you can distinguish by using selects, cases, or an AND node with the current value. Once you know whether it just went down or came up, update the motor to the appropriate value, as your code already was doing.
By the way, the bottom * portion of the feedback node is for initialization. My code left it blank which may not be appropriate. The better choice is probably to wire the button to both the input of the node and the * initializer.
Greg McKaskle
|