|
Re: servo
Have a feedback node keep the current value of the servo, which is always writing to it. Have a case structure so that when you press the button, it adds five to the value.
With that setup, it will add 5 degrees every single time the loop runes (which is quite fast). If you want to wait for the button to release and then repress before it adds another five, you will have to add another feedback node. This one would keep the value of another case structure, around the first one. You wire the output of the feedback node into the input of the case structure. This would have several names as the cases: Try calling them "Button Pressed" and "Button Released"
The button released state would look for the button to be pressed, and when that happens would send the +5 degree command and the "Button Pressed" constant to the feedback node. In the Button Pressed state, it would give either a value of "Button Pressed" to the feedback node if the button was pressed or a value of "Button Released" if the button was released. At that point, it would go back to button released and start over.
I guess I'll attach some code.. One of them is how I said to do it in this post, and the "simplified" version is one that uses no case structures and very few functions.
|