Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Arduino and Stepper motor pin configuration
#1
I/O Connect to Controller : to pins 8, 10, 9, 11
[Image: arduino%20stepper.JPG]
Use below program  for your stepper motor driver trials
#include <Stepper.h>
#define STEPS 32   
#define STEPSREV 32 * 64  //2048  

Stepper stepper1(STEPS, 8, 10, 9, 11);
int  Steps2Take;
void setup()  
{

}
void loop()
{
  stepper1.setSpeed(1);
  Steps2Take  =  4;  
  stepper1.step(Steps2Take);
  delay(2000);

  Steps2Take  =  STEPSREV / 2;
  stepper1.setSpeed(100);   
  stepper1.step(Steps2Take);
  delay(1000);
 
  Steps2Take  =  + STEPSREV / 2;
  stepper1.setSpeed(700);
  stepper1.step(Steps2Take);
  delay(2000);

  Steps2Take  =  - STEPSREV/ 2;  
  stepper1.setSpeed(700);
  stepper1.step(Steps2Take);
  delay(2000);
}

Arduino and Stepper motor
Reply
#1
I/O Connect to Controller : to pins 8, 10, 9, 11
[Image: arduino%20stepper.JPG]
Use below program  for your stepper motor driver trials
#include <Stepper.h>
#define STEPS 32   
#define STEPSREV 32 * 64  //2048  

Stepper stepper1(STEPS, 8, 10, 9, 11);
int  Steps2Take;
void setup()  
{

}
void loop()
{
  stepper1.setSpeed(1);
  Steps2Take  =  4;  
  stepper1.step(Steps2Take);
  delay(2000);

  Steps2Take  =  STEPSREV / 2;
  stepper1.setSpeed(100);   
  stepper1.step(Steps2Take);
  delay(1000);
 
  Steps2Take  =  + STEPSREV / 2;
  stepper1.setSpeed(700);
  stepper1.step(Steps2Take);
  delay(2000);

  Steps2Take  =  - STEPSREV/ 2;  
  stepper1.setSpeed(700);
  stepper1.step(Steps2Take);
  delay(2000);
}

Arduino and Stepper motor
Reply
CAA


Forum Jump:


Users browsing this thread: 1 Guest(s)