Setting a servo to a position

NickB:
The servo is a HItec HS-422 and it does work fine on other programs.

Do you mean that if you leave the hardware alone and upload a different sketch, you can get it working? If so that's significant because it points to a software problem, whereas all the other evidence seems to suggest a wiring fault.