code to control gear motor

I'm going to program on gear motors. How can I control the voltage and the rotation speed? How can I control whether it's turning clockwise or counterclockwise? It'll be great honor if someone could give me a sample of the code to control gear motor.

Typically with PWM.
Typically with an H-bridge or DPDT relay.

Google is an excellent tool.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .

Thanks.. Tom... :slight_smile: