Does my servo have a problem? or is it my code?

How are you powering the servo? Does it have the full voltage it needs? It probably doesn't if you are powering it off the Arduino....