I'm trying to control a futaba s3003 servo motor using raspberry pi 3 but when I run the code the servo just moves a bit then stops. The servo's power is connected to external 6v power supply and I also connected the power supply ground to pi ground and the servo ground to pi ground too.
servo.py
import RPi.GPIO as gp
gp.setmode(gp.BOARD)
gp.setup(7,gp.OUT)
p = gp.PWM(7,50)
p.start(5)
p.ChangeDutyCycle(11)#tried 2,7.5,11,12
So every time I change the duty cycle and run it, it just moves a bit then will stop and keeps going like that. I want to go from 0 to 180. What am I doing wrong?