FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with programming an Arm with an Encoder

Hi I am fairly new at programming using an encoder and need some assistance. I wanted to program an arm with an encoder to go to a position and HOLD THERE on the press of a button until ANOTHER BUTTON is pressed. (so like a loop keeps running holding the arm in place, like if the arm is lower than it should be the code moves it back up and if its high moves it lower... until another button is clicked)

0 Kudos
Message 1 of 2
(3,133 Views)

It sounds like the type of program you're looking to design would work well with a state machine architecture. You can find a lot of information on the state machine architecture in this tutorial on ni.com http://www.ni.com/white-paper/3024/en . You could have a state that extends the arm, one that retracts it, and one that holds the arm in place. The current state of the machine could be controlled by a front panel control, like the buttons you were discussing.

I hope that helps.

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 2 of 2
(2,530 Views)