STEPPER P28,27,26,25

Dependencies:   mbed sMotor

Fork of Stepper_4 by Nuno Sarmento

main.cpp

Committer:
rajivwagle
Date:
2018-03-08
Revision:
1:28e6a06c01dd
Parent:
0:6999a083fb46

File content as of revision 1:28e6a06c01dd:

/*
############################################
##           sMotor v0.1 Test Program     ##
##          created by Samuel Matildes    ##
############################################
        ---- sam.naeec@gmail.com -----
This library was made for 4-Phase Stepper Motors
I don't take any resposability for the damage caused to your equipment.

*/

#include "mbed.h"
#include "sMotor.h"


Serial pc(USBTX, USBRX);
sMotor motor(p25, p26, p27, p28); // creates new stepper motor: IN1, IN2, IN3, IN4

int step_speed = 1200 ; // set default motor speed
int numstep = 512 ; // defines full turn of 360 degree
//you might want to calibrate this value according to your motor


int main() {

    //Credits
    printf("4 Phase Stepper Motor v0.1 - Test Program\r\n");
    printf("developed by BMW\r\n");
    printf("\n\r");

    // Screen Menu
     

    while (1) {

        

            
                motor.step(numstep,0,step_speed); // number of steps, direction, speed

             
                motor.step(numstep,1,step_speed);

            
                motor.step(numstep/2,0,step_speed);

             
                motor.step(numstep/2,1,step_speed);

            
        }
  
}