[Del] Programming a step Motor, rotation of 90 ° ?

Hello, i need help because i would like to program a step motor (ref : 55SI-25DAYA). I just want to create a rotation of 90° but i have somes issues, i just don’t no how to do this and i have tried fews things. Someone can help me ?

Wiring in attachment.

Program used

#include <Stepper.h>
Stepper moteur(48, 3, 12, 11, 13);

 
void setup()
{
  pinMode (5,OUTPUT);
    moteur.setSpeed(10); 
}
 
void loop()
{
  digitalWrite (5,HIGH);
   moteur.step(1000);
    delay(500);

  }

Source : Composants électroniques .: DZElectronique :.
Modélisme/CNC/Hardware/Moteur 55SI-25DAYA — Ordinoscope.net

Please read the "How to use this forum" post and follow the directions. Post your code properly, using code tags.

The code you posted does something. Send me a PM and I'll send you a snail mail address, so you can send me your hardware, so I can see what it actually does.

You expect it to do something. You'll need to explain what you expect it to do.

Actually creating an instance of the Stepper class is something that most people need to do. How did you avoid that need?

I just want to create a rotation of 90 degrees with my step motor ( 55SI-25DAYA) and i don't no how to do that

You want the stepper to rotate 1/4 turn on every pass through loop()? Or only to rotate 1/4 turn once?

The first argument to the Stepper constructor is what? It is NOT a random number.

The argument to step() is? It is NOT a random number.

Why does there not appear to be a correlation between the two values?

(deleted)

Your call to the constructor tells it that the motor steps 48 times to complete one revolution. To then step a 1/4 turn once, in setup() step(12) would be used.

If you do the stepping in loop(), you'll either need to use a flag to indicate that all necessary stepping has, or has not, happened, or you will step more than 1/4 revolution.

(deleted)

(deleted)

(deleted)

spycatcher2k:
From the site you posted a link to :

Pas / tour 48 (7.5°/pas) <-------- All the info you needed is here :slight_smile:
Type unipolare (6 fils)

If it has 6 wires maybe it can also be operated as a bipolar motor and use a DRV8825 stepper driver as mentioned on the website linked to in the Original Post. That would make the programming very much easier.

And if you already have a DRV8825 you should be aware that the standard Stepper library is not intended for it. Either use the Accelstepper library or just write your own code similar to my Simple Stepper Code

…R
Stepper Motor Basics

Okay i understand, soo, this is correct ?

That could move the stepper 1/4 turn, then wait, and then move it back to the original position, over and over and over.

That is NOT what you said you wanted, so, I'd have to say, no it is not correct.

void setup()
{
  pinMode (5,OUTPUT);
    moteur.setSpeed(30);
 void loop() // Boucle
{

That won't even compile. Why did you bother posting that?

Why not ?

You have the code. You have the compiler. YOU figure out why the code won't compile. The compiler is not the least bit shy about telling you what you are doing wrong. AND, it will tell you far faster than we can, with way less "you dumb ass" tone thrown in.

Okay, finally it's done tmy new wiring and my program is correct. But i can't remove the post,
A moderator could do it for me ?

(deleted)

Are there a bunch of posts missing here?