problem with simply step motor code.

hello,
can someone explain me where is the problem…
Thank you very much.
sorry for my english, i try to move my stepper motor, following my simple code :

#include <Stepper.h>
#define STEPS 800
Stepper assex(STEPS, 13, 7);

void setup()
{
stepper.setSpeed(60);
}

void loop()
{
assex.step(400);
delay(1000);
}

can someone explain me where is the problem..

You have said nothing about: the stepper motor how it is connected to the Arduino how it is powered what happens when you run that code what you expect to have happen when you run that code.

So, no.

Use

// code tags like this

please....

I have a all in one stepper driver motor drier ( http://www.ideegeniali.it/shop/lang-it/15-cobra.html ) this stepper motor driver is connected to pin 13 and pin 7 of arduino ( dir e step of pin of motor driver)

5 questions, 2 answers is the wrong ratio.

The motor pawer is 24V dc attached to Driver . when i start the code motor doesn't start. i expect motor do 400 steps and stop for 1 second , 400 steps and stop for 1 second to infinite.

if i use a sceckh from internet the motor start.

#include <StepperDriver.h>

const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution for your motor
StepperDriver myStepper; //initialize for one stepper

void setup() {
myStepper.setStep(stepsPerRevolution, 12,10);
myStepper.setSpeed(8); //with 1/8th stepping turned on, 1 rpm * 8 = 8
myStepper.step(stepsPerRevolution*8); //with 1/8 stepping turned on, one full revolution needs to be multiplied x 8
}

void loop() {
// step one revolution in one direction:

if (myStepper.update() == 1){ //here we check to see if the motor has finished the last step command and at the same time call the update for the motor to keep running
delay(1000); //when a full revolution is complete, wait 1second and do another full rev.
myStepper.step(stepsPerRevolution*8);
}
}

if i use a sceckh from internet

The internet is a big place...

How fast is 8)?

How many steps is stepsPerRevolution*8)?

hello, to try i take this and i put motor speed 60 , and 800 step x revolution. all is ok but i do not understand what is this:

if (myStepper.update() == 1)

other think: i try to stop the motor after 400 steps using function Delay(1000), in this case motor do not start.

Have you a ground connection between the stepper driver and the Arduino?

Your second sketch seems to use different Arduino pins. They can't both be correct.

...R

but i do not understand what is this:

It looks like the library you are using in this code moves the stepper in a non-blocking fashion. The library you were using moves the stepper in a blocking fashion. That is, the first code does nothing else while the motor is moving. That makes it hard to move two motors at the same time, like a plotter needs to move.

The update() call makes the stepper motor step once. It returns true if the required number of steps has happened. Otherwise, it returns false, so you know to keep trying.

i try to stop the motor after 400 steps using function Delay(1000), in this case motor do not start.

It will move. It will just be incredibly slow, waiting 4 seconds between microsteps.