How to control DC motor forward and reverse with one potentiometer

I've done this plenty of times with servos but now the components need to be basic, dc motors.

Then my solution is the one you want to use.

It gets data from the 2 pots and tells the motors how to move.If you dont like my second way, then just repeat my first way for both motors.

This controls the forward and backwards movement of ONE motor, repeat for second motor.

// say the lowest is 350 and the highest is 650, the difference is 300
// so divide 300 by 2, you get 150.
// then 350 + 150= 500 (center) 
//offset, you decide how much dead zone you want, for the center. 
// +-10 should be enough.
If( POT1< 490) { // offset(10) - center(500)
...go forward...
}
Else if (POT1 > 510) {
... Go backwards...
}
Else { 
... Full stop...
}