MisterBotBreak
Published

How to Code Step Motor

In this project we will learn how to use step motor with code.

BeginnerProtip1 hour14,203
How to Code Step Motor

Things used in this project

Hardware components

Jumper wires (generic)
Jumper wires (generic)
×6
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Step motor with driver
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Step motor .ino

Arduino
#include <Stepper.h> 

int numberofstep = 48*64; 
                                  

Stepper motor(numberofstep,9,11,10,6);    // we use pins 9, 11, 10, 6        
void setup() 
{ 
 
  motor.setSpeed(9); // we set motor speed at 9
}
void loop() 
{ 
  motor.step(600); // the motor will run during 600 step (you can change the step)
  motor.step(-800); // the motor will run during 800 step in reverse (you can change the step)

}

Credits

MisterBotBreak

MisterBotBreak

37 projects • 66 followers
I love electronic and I make explanatory project on how to control sensors.
Thanks to Pierre Loc ( pictures ).

Comments