WRONG code, ... motor delay or speed change

hi,

searching for simple way how to delay motor2 or increase speed separately for both motors or at least for motor2. tried to add another potentiometer (A1) and duplicate commands for motor2, but code bugged, please help :slight_smile:

The function runToNewPosition() blocks the Arduino until the move is complete. That means your motors will run one at a time. Is that what you want?

As far as I can see your program is designed to change the number of steps when you adjust the potentiometer.

I don't know what exactly you mean by "delay motor2 or increase speed separately for both motors or at least for motor2". Do you mean that you want the potentiometer to vary the speed rather than the distance? Or are you thinking of adding more potentiometers to control the speed.

...R
Stepper Motor Basics
Simple Stepper Code

Hi Robin2,

I tried do both things.

with that "experimental" code tried to add another potentiometer for motor 2, didn't worked,

so thinking at least would be great that potentiometer would vary the speed of motor 2,

kemanius:
so thinking at least would be great that potentiometer would vary the speed of motor 2,

Start simple.

Write a program that uses a potentiometer to vary the speed of one motor. Don't try to do it for two motors until you have it working for one.

If you get stuck post the program that represents your best attempt.

...R

THATS A GREAT IDEA THANKS