12VSTEPPER MOTOR CONTROL WITH ANALOG--NEED HELP

Hello I am trying to control a stepper motor with a potentiometer, but eventually I would like to use a pulse sensor to move the motor.

I'm using this biploar stepper motor: http://www.adafruit.com/products/324

I've gotten it to work using this motor sheild: http://arduino.cc/it/Main/ArduinoMotorShieldR3

using code i found here: http://arduino.cc/forum/index.php?topic=89468.0

But I'm confused as to how to create code that will allow the potentiometer to control this motor.

(I'm new to arduino!!)

Any help would be awesome!! :astonished: :astonished: :astonished:

This is ironic. Someone named lownoise screaming at us.

But I'm confused as to how to create code that will allow the potentiometer to control this motor.

So, you've noticed that a stepper motor steps. It does nothing else. How, exactly, do you want a potentiometer to "control" the stepper motor?

By control he means regulate the motor's speed and direction using the potentiometer.

I have the same question, some sample code would be greatly appreciated!

Thanks, -Slam

Let’s say you take 10K potentiometer. When you connect it(potentiometer) to arduino, it will show you the numbers from 0 to 1023.
Middle position of potentiometer should show you something about 510-512.
So(if i am not wrong) the code should look like:
val = analogRead(potentiometer_pin);
if(val >= 510K && val <= 512)
stepper.stop();
else if(val >= 513)
turn.right();
else
turn.left();

So(if i am not wrong) the code should look like:
val = analogRead(potentiometer_pin);
if(val >= 510K && val <= 512)

Well, that K looks out of place…