Making 2 DC motors going all directions

Hello fellow programmers,

A quick question :

I have 2 DC motors placed like this motors.

I have ONE potentiometer wich controls the speed of the 2 motors. How do I make them turn left , right ,let-backward , left-forward ? With other words in all directions ;). I've been looking around but just didn't find exactly what I want.

Do you guys have any idea how to program this with analogWrite ?

Thanks !

You did not explain what Arduino you are using, or if an Arduino is even involved in this little project.

You did not explain anything about the motors. You probably need a shield for your Arduino for driving motors. The shield may come with an example program that uses analogWrite or does something even better.

The ends of the potentiometer could be connected to 3.3 volts and ground if the potentiometer is high enough in resistance. You did not tell us anything about the potentiometer. The variable tap can be connected to an analog input on the Arduino. The Arduino will then know how the potentiometer is set. The setting could provide information about speed and direction. It won't be pretty (even an automobile has a separate accelerator pedal, brake, and steering wheel) but it could work.

If you want further design information rather than doing some of the work yourself, head on over to "Gigs and Collaborations" and bring your wallet. You will still have to provide more information. A photograph is helpful but insufficient.

It's in dutch but I hope you can make the big headlines out of it :smiley:

There was only a picture. There were no headlines, big or small.

In any case, I am sure that your English is much much better than my Dutch. My Dutch is nonexistent.

Try ebay search "joystick arduino". U'll find the PS2-stick..

Alternative: get another potmeter (one for each motor / or one for overall speed, the other for steering)
I think the joystick is the better choise.

(you may have one already ? in some old toy?)

not recommended:
With just one potmeter, you can add two pushbutton to select which motor should have increased speed.
=> the pot middle position= stop
=> turn left for reverse
=> turn right for forward
=> sw A : incr speed for motor A and decr for motor B
=> sw B : oposite of A

Hi guys I splitted the word file so you can see my report about what I mean.

Hi,
OPs chassis.

Its a standard "robot" chassis.

Can you tell us your electronics, programming, Arduino, hardware experience?

Tom.. :slight_smile: