How to replace a mechanical Potentiometer with arduino controlled digital Pot?

We'll need to see a full schematic showing how you have connect the chip to the Arduino and to the motor and power supply.

We'll also need a link to the data sheet for the chip.