Potentiometer
Driving DC motors with digital signals is a common problem, and the h-bridge is designed specifically for that purpose.
The resistance of the potentiometer changes as you turn the control. The device has three connections. The middle one is the output and the others are power in and ground. Usually, the ground is on the left.