Digipot for DC motor
Digital potentiometers are designed to control low power signals that must be passed through a variable resistance, eg. the volume control in an audio amplifier. Most are only capable of handling 1~2mA, not nearly enough to power an electric motor which could draw several Amps. 

Now that doesn't mean you can't use a digital pot, but you will need something to boost its output current. A bipolar transistor is the obvious choice, since it is a current amplifier. However it also has limitations. High power transistors generally have low current gain, so you will probably need at least two transistors to get enough gain. Also some voltage loss may occur due to biasing requirements.                 

Here is a circuit that uses an MCP4231-502 and an NPN and PNP transistor to control motor voltage at up to 3 Amps. The 2N4401's typical current gain (Hfe) is about 180 at 100mA collector current, and the TIP42's is about 30 at 3A, for a total of 180 x 30 = 5400. Therefore at 3A output current the load on the MCP4231 should be well under 1mA. 







simulate this circuit &ndash; Schematic created using CircuitLab

One possible problem with this simple circuit is that bipolar transistors need about 0.6V between Base and Emitter to turn on; so Q1 won't turn on until the potentiometer gets up to 0.6V, and Q2 absorbs about 0.6V from the motor supply. As a result, this circuit can only supply a maximum of about 2.4V to the motor. If you need to control motor voltage over a wider range then a few extra components will be required.