Servo control with while

this feels like a school project. What have you tried?