I will like to control the position of the arm of the servo motor with a joystick. I got the arm to move in sync with the joystick i.e when I move the thumbstick/joystick upwards to the maximum upward position the arm also moves to the maximum position and when I release the thumbstick/joystick to its neutral position( this is the centre position on it) the arm quickly follows it and moves to its middle or 0 degree position also.
However, I want to be able to move the joystick upward and when I release it (joystick) to its initial centre position, the arm on the servo motor will remain in that upward max position and when I pull the joystick down it will move the arm in the downward or opposite direction.
In addition, I will like that when the arm is its upward most position that if something manually, like my finger or some object turns the arm out of position that the arm will automatically go back to the position it was in before that disturbance.
The following is my code : http://codeviewer.org/view/code:446c