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

PaulS:
"It doesn't work" is almost enough to make me go on to the next post, where the poster just might actually explain what the code does, what he/she expects, and how he/she has determined that the correct output is not being obtained.

I'm sorry for this, but I don't know how to explain it. The electric skateboard moves when I use the mechanical pot in the remote control and doesn't do any attempt to move when I use the digital pot.