Controlling Two Dc motors with a 2 potentiometers

Hey, I'm new to arduino and I could use a little help. What I am trying to do is use a motor shield and a parallax joystick consisting of two potentiometers to control two motors. Like in this picture: I believe that have done the circuit right, make sure to correct me if I am wrong, but when ever I try code it doesn't work, probably because I'm really bad at coding. So if anyone has an idea of where to start with code, it would be much appreciated if they would tell me.

Thank you <3 <3 <3

Finalcircuit.fzz (4 KB)

I am still learning arduino myself, but pot's are good for small currents like signals. It would be better to use PWM to control the motors. Depending on the size of the motor and the current it will be drawing, you will either have to use a transistor (for tiny motors) or MOSFET (for larger motors). If you want the motors to go forward and backwards, you would need to make an H bridge.

its a bit hard to avoid using the pots though because they are included in the joystick I'm using, and isn't the point of the motor shield to avoid using transistors, h bridges and MOSFETs? Of course I could be wrong because I do have little idea what I'm doing..

I see you've got a couple of pots and a couple of motors, and presumably an Arduino with some sort of motor shield or drive circuit to power the motors.

So, what's it supposed to do?

basically I want the joy stick when moved up to move one way and when moved down to move the other way same for the other motor but when moved to the left and the right

http://www.parallax.com/tabid/768/ProductID/581/Default.aspx

Is that your joystick? I think I know what you want to do.

You want to use the joystick to control two motors like an RC car right? Press forward, the motor turns, press left, the other motor turns?

You would probably want to do it like this...

Have the joystick wired to the arduino analog pins and use the analogRead() function to get their values. You should use the Serial monitor to figure out the calibration values...

Something like..

void setup(){
Serial.begin(9600);
}

void loop(){
Serial.println(analogRead(x)); //x is the pin your pot is connected to
delay(1000);

move the stick around and take note of the max/min and center values.

Then you will plug your motor shield in, (a link to your shield would be very helpful) and use the arduino to control the motors through it.
Use those values and analogWrite() to set the speed of your motor and digialWrite to set the direction.

Take a look at my other thread to get a few ideas, it is kinda similar:
Fuzzy logic:
http://arduino.cc/forum/index.php/topic,105758.0.html

http://arduino.cc/en/Main/ArduinoMotorShieldR3 there is a link to the shield, and would I use an if statement for this?

Thank you

also the serial monitor is showing it starting at 0 then climbing up to 1023 then climbing back down to 0 without me touching it...
I'm also using the 9V instead of the provided 5V if that makes a difference

cdsupina:
basically I want the joy stick when moved up to move one way and when moved down to move the other way same for the other motor but when moved to the left and the right

Just forwards and backwards, or do you also want to control the speed?

Do you understand how to connect the 'joystick' potentiometer to an analog input and have your sketch read the position ?

Do you understand how to connect your motor to the Arduino via the driver shield and make the motor run forwards and backwards by setting the appropriate output pins?

it would be nice to control speed, so yes, I would, but I do not understand much of your to questions.