Potentiometer Controlled Motor with Feedback

Have you looked at the examples in the Playground?