Hi there,
Another possibility depending on accuracy and other things, is you may be able to
use a digital pot. A digital pot is a chip that accepts digital signals and provides
outputs that look to the outside world like an actual potentiometer.
Thus, you control the digital pot with digital signals and the pot controls the
circuit for the motor just like with an ordinary pot.
There are some limits for these devices but many times they still work ok for
lots of types of applications.
Im sure people here can point you to some part numbers, or do a search for
'digital potentiometer'.